Update .gitlab-ci.yml

This commit is contained in:
TheJoKlLa 2022-05-24 07:50:34 +00:00
parent 4a58558b75
commit 688f467b33

View File

@ -11,17 +11,10 @@
docker-build: docker-build:
# Use the official docker image. # Use the official docker image.
image: docker:19-dind image: jdrouet/docker-with-buildx
tags:
- docker
- arm64
- linux
stage: build stage: build
services: services:
- docker:dind - docker:dind
variables:
DOCKER_TLS_CERTDIR: ""
before_script: before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
# Default branch leaves tag empty (= latest tag) # Default branch leaves tag empty (= latest tag)
@ -35,8 +28,8 @@ docker-build:
tag=":$CI_COMMIT_REF_SLUG" tag=":$CI_COMMIT_REF_SLUG"
echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag" echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag"
fi fi
- docker build --pull -t "$CI_REGISTRY_IMAGE${tag}" . - docker buildx create --use
- docker push "$CI_REGISTRY_IMAGE${tag}" - 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 # Run this job in a branch where a Dockerfile exists
rules: rules:
- if: $CI_COMMIT_BRANCH - if: $CI_COMMIT_BRANCH