From 2f2d2216af6d24c14dbb62a677aa1b8f7e40ca70 Mon Sep 17 00:00:00 2001 From: Kai Kriegel Date: Mon, 13 Dec 2021 23:57:14 +0000 Subject: [PATCH] switch docker build to buildx for multiarch --- .gitlab-ci.yml | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 100d4dd..d68c854 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -97,17 +97,29 @@ build:docker-releases: - docker build:docker-development: - image: - name: gcr.io/kaniko-project/executor:v1.6.0-debug - entrypoint: [""] + image: docker:20.10.11 + + services: + - docker:20.10.11-dind + + variables: + DOCKER_DRIVER: overlay2 + BUILDX_VERSION: "v0.7.1" + BUILDX_ARCH: "linux-amd64" before_script: - - '' + - echo "$CI_REGISTRY_PASSWORD" | docker login $CI_REGISTRY --username + $CI_REGISTRY_USER --password-stdin + # - wget -O /usr/bin/docker-buildx + # https://github.com/docker/buildx/releases/download/${BUILDX_VERSION}/buildx-${BUILDX_VERSION}.${BUILDX_ARCH} + # - chmod +x /usr/bin/docker-buildx script: - - mkdir -p /kaniko/.docker - - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json - - /kaniko/executor --force --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:dev-latest - only: - - development + - docker-buildx create --use + - docker-buildx build + --platform linux/386,linux/amd64,linux/amd64,linux/arm/v7,linux/arm64/v8 + --tag ${CI_REGISTRY_IMAGE}:test + --push + # only: + # - development tags: - linux - docker