deemix-docker/.gitlab-ci.yml

37 lines
1.5 KiB
YAML
Raw Normal View History

2020-06-05 20:49:21 +00:00
image: docker:latest
services:
- docker:dind
stages:
- build
variables:
IMAGE: registry.gitlab.com/bockiii/deemix-docker
2020-06-11 18:45:28 +00:00
IMAGE_TAG: latest
2020-06-05 20:49:21 +00:00
DOCKER_CLI_EXPERIMENTAL: enabled
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- apk add --update curl && rm -rf /var/cache/apk/*
2020-06-11 18:45:28 +00:00
- export CI_JOB_TIMESTAMP=$(date --utc -Iseconds)
2020-06-05 20:49:21 +00:00
2020-06-05 21:45:21 +00:00
build:
2020-06-05 21:23:47 +00:00
stage: build
2020-06-05 20:49:21 +00:00
script:
2020-06-05 21:45:21 +00:00
- docker run --rm --privileged multiarch/qemu-user-static:register --reset
2020-06-11 18:45:28 +00:00
- docker build --pull -f Dockerfile.arm64v8 --build-arg BUILDDATE=$CI_JOB_TIMESTAMP -t $IMAGE:arm64v8-${IMAGE_TAG} .
- docker build --pull -f Dockerfile.arm32v7 --build-arg BUILDDATE=$CI_JOB_TIMESTAMP -t $IMAGE:arm32v7-${IMAGE_TAG} .
- docker build --pull --build-arg BUILDDATE=$CI_JOB_TIMESTAMP -t $IMAGE:amd64-${IMAGE_TAG} .
- docker push $IMAGE:arm64v8-${IMAGE_TAG}
- docker push $IMAGE:arm32v7-${IMAGE_TAG}
- docker push $IMAGE:amd64-${IMAGE_TAG}
- docker manifest create "$IMAGE:${IMAGE_TAG}"
"$IMAGE:amd64-${IMAGE_TAG}"
"$IMAGE:arm32v7-${IMAGE_TAG}"
"$IMAGE:arm64v8-${IMAGE_TAG}"
- docker manifest annotate "$IMAGE:${IMAGE_TAG}" "$IMAGE:arm32v7-${IMAGE_TAG}" --os=linux --arch=arm --variant=v7
- docker manifest annotate "$IMAGE:${IMAGE_TAG}" "$IMAGE:arm64v8-${IMAGE_TAG}" --os=linux --arch=arm64 --variant=v8
# Push manifest to official registry
- docker manifest push "$IMAGE:${IMAGE_TAG}"
# Validate multi-arch manifest
2021-03-29 08:58:34 +00:00
- docker run --rm mplatform/mquery $IMAGE:${IMAGE_TAG}