This commit is contained in:
Matthew McClaskey 2021-10-27 16:28:25 +00:00
parent 911cacf261
commit 51bcae5f67

View File

@ -4,7 +4,7 @@ services:
variables: variables:
DOCKER_AUTH_CONFIG: ${_DOCKER_AUTH_CONFIG} DOCKER_AUTH_CONFIG: ${_DOCKER_AUTH_CONFIG}
PLATFORM: "linux/amd64" PLATFORM: "linux/amd64"
ARM_BUILDS: ",chromium,firefox,ubuntu,terminal,remmina,rdesktop," ARM_BUILDS: ",chromium,firefox,ubuntu-bionic-desktop,terminal,remmina,rdesktop,"
stages: stages:
- build - build
@ -49,8 +49,9 @@ build_dev:
stage: build stage: build
image: kasmweb/docker-buildx-private:develop image: kasmweb/docker-buildx-private:develop
script: script:
- if [[ "$ARM_BUILDS" == *"$KASM_IMAGE"* ]]; then PLATFORM="linux/amd64,linux/arm64"; fi; - BUILD_PLATFORM=$PLATFORM
- echo "Building ${KASM_IMAGE} for platforms ${PLATFORM}" - if [[ "${ARM_BUILDS}" == *",${KASM_IMAGE},"* ]]; then BUILD_PLATFORM="linux/amd64,linux/arm64"; fi;
- echo "Building ${KASM_IMAGE} for platforms ${BUILD_PLATFORM}"
# to get qemu ready # to get qemu ready
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
# to prepare the buildx env # to prepare the buildx env
@ -60,7 +61,7 @@ build_dev:
- ls docs/$KASM_IMAGE/description.txt - ls docs/$KASM_IMAGE/description.txt
# Equivilant to docker build and docker push. Builds amd64 natively uses qemu for arm64. # Equivilant to docker build and docker push. Builds amd64 natively uses qemu for arm64.
# The only way to push multiple architectures to the same tag is to use buildx. # The only way to push multiple architectures to the same tag is to use buildx.
- docker buildx build --push --platform $PLATFORM -t ${ORG_NAME}/$KASM_IMAGE-private:$SANITIZED_BRANCH --build-arg BASE_TAG="develop" -f dockerfile-kasm-$KASM_IMAGE . - docker buildx build --push --platform $BUILD_PLATFORM -t ${ORG_NAME}/$KASM_IMAGE-private:$SANITIZED_BRANCH --build-arg BASE_TAG="develop" -f dockerfile-kasm-$KASM_IMAGE .
except: except:
- develop - develop
- /^release\/.*$/ - /^release\/.*$/