diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3a4c370..1f4bb6b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,17 +11,10 @@ docker-build: # Use the official docker image. - image: docker:19-dind - tags: - - docker - - arm64 - - linux + image: jdrouet/docker-with-buildx stage: build services: - docker:dind - variables: - DOCKER_TLS_CERTDIR: "" - before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY # Default branch leaves tag empty (= latest tag) @@ -35,8 +28,8 @@ docker-build: tag=":$CI_COMMIT_REF_SLUG" echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag" fi - - docker build --pull -t "$CI_REGISTRY_IMAGE${tag}" . - - docker push "$CI_REGISTRY_IMAGE${tag}" + - docker buildx create --use + - docker buildx build --push --platform linux/arm/v7,linux/arm64/v8,linux/386,linux/amd64 --tag "$CI_REGISTRY_IMAGE${tag}" . # Run this job in a branch where a Dockerfile exists rules: - if: $CI_COMMIT_BRANCH