Created
September 6, 2021 15:07
-
-
Save Links2004/7109986170e3e6a028be912720c343f4 to your computer and use it in GitHub Desktop.
docker buildx gitlabci
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stages: | |
- build | |
- test | |
docker-build-master: | |
tags: | |
- docker | |
image: jonoh/docker-buildx-qemu | |
stage: build | |
before_script: | |
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY | |
- docker run --name qemu-user-static --rm --privileged multiarch/qemu-user-static --reset -p yes | |
- docker buildx create --driver docker-container --use | |
- docker buildx inspect --bootstrap | |
- update-binfmts --enable | |
script: | |
- docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 --pull -t "$CI_REGISTRY_IMAGE" --push . | |
only: | |
- master | |
docker-build: | |
tags: | |
- docker | |
image: jonoh/docker-buildx-qemu | |
stage: build | |
before_script: | |
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY | |
- docker run --name qemu-user-static --rm --privileged multiarch/qemu-user-static --reset -p yes | |
- docker buildx create --driver docker-container --use | |
- docker buildx inspect --bootstrap | |
- update-binfmts --enable | |
script: | |
- docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" --push . | |
except: | |
- master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment