Skip to content

Instantly share code, notes, and snippets.

@Links2004
Created September 6, 2021 15:07
Show Gist options
  • Save Links2004/7109986170e3e6a028be912720c343f4 to your computer and use it in GitHub Desktop.
Save Links2004/7109986170e3e6a028be912720c343f4 to your computer and use it in GitHub Desktop.
docker buildx gitlabci
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