-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
28 lines (26 loc) · 957 Bytes
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
variables:
VERSION: "3.0.5"
docker-build:
image: jdrouet/docker-with-buildx:stable
stage: build
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
services:
- docker:dind
before_script:
- echo "${CI_REGISTRY_PASSWORD}" | docker login -u "${CI_REGISTRY_USER}" --password-stdin "${CI_REGISTRY}"
- echo "${DOCKERHUB_ACCESS_TOKEN}" | docker login -u "${DOCKERHUB_USERNAME}" --password-stdin
script:
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes; docker buildx create --use
- |
docker buildx build --push --platform linux/amd64,linux/arm/v7 \
--tag "${CI_REGISTRY_IMAGE}:${VERSION}" \
--tag "${CI_REGISTRY_IMAGE}:latest" \
--tag "${DOCKERHUB_USERNAME}/${CI_PROJECT_NAME}:${VERSION}" \
--tag "${DOCKERHUB_USERNAME}/${CI_PROJECT_NAME}:latest" \
.
rules:
- if: $CI_COMMIT_BRANCH
exists:
- Dockerfile