Skip to content

Instantly share code, notes, and snippets.

@paolobarbolini
Created November 12, 2023 17:27
Show Gist options
  • Save paolobarbolini/74318634376c7c1304f094bb75692019 to your computer and use it in GitHub Desktop.
Save paolobarbolini/74318634376c7c1304f094bb75692019 to your computer and use it in GitHub Desktop.
Gitlab CI example for MultiArch images
image: docker:latest
variables:
DOCKER_BUILDKIT: 1
services:
- docker:dind
build:
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
# https://github.com/docker/buildx/issues/413
- docker context create multiarch-context
- docker buildx create --name multiarch-builder --use multiarch-context --bootstrap
- docker buildx build --push --platform linux/arm64,linux/amd64 --tag $CI_REGISTRY_IMAGE:latest .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment