Skip to content
Snippets Groups Projects

FEAT(multi-arch): add support for multi arch

Closed Kay Effenberger requested to merge feat-multi-arch into main
2 files
+ 20
14
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 11
8
image: docker:stable
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_TLS_CERTDIR: ""
stages:
- test
@@ -33,6 +35,7 @@ run_test_cases:
junit: report.xml
check_coverage:
image: python:3.9
stage: test
needs: ["run_test_cases"]
before_script:
@@ -48,6 +51,7 @@ check_coverage:
path: coverage.xml
check_style:
image: python:3.9
stage: test
needs: ["run_test_cases"]
before_script:
@@ -59,29 +63,28 @@ check_style:
docker-push:
# Use the docker image with buildx support for multi arch.
image: jonoh/docker-buildx-qemu
image: jdrouet/docker-with-buildx:20.10.21-0.9.1
stage: release
variables:
# the name of the image without version
AURA_IMAGE_NAME: "autoradio/engine-recorder"
services:
- docker:dind
- docker:20.10.21-dind
before_script:
# default repo is docker.io (aka docker hub)
- docker login -u "$DOCKER_ID" -p "$DOCKER_HUB_AUTH"
- docker buildx create --driver docker-container --use
- docker buildx inspect --bootstrap
- docker buildx create --use
script:
# Important: Ensures execution of other binary formats is enabled in the kernel
- update-binfmts --enable
# every commit on main branch should build image as unstable
# else it is from a tag (enforced by gitlab-ci rules)
# hint: tags are references independent of branches
- |
if [ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]
then docker buildx build --platform linux/arm/v6,linux/arm64/v8,linux/amd64 -t $AURA_IMAGE_NAME:unstable --push.
else docker buildx build --platform linux/arm/v6,linux/arm64/v8,linux/amd64 -t $AURA_IMAGE_NAME -t $AURA_IMAGE_NAME:$CI_COMMIT_TAG --push.
then docker buildx build --platform linux/arm/v7,linux/arm64/v8,linux/amd64 -t $AURA_IMAGE_NAME:unstable .
else docker buildx build --platform linux/arm/v7,linux/arm64/v8,linux/amd64 -t $AURA_IMAGE_NAME -t $AURA_IMAGE_NAME:$CI_COMMIT_TAG .
fi
- docker push "$AURA_IMAGE_NAME" --all-tags
rules:
# - *release-rules
- if: $CI_COMMIT_TAG =~ /^\d+[.]\d+[.]\d+$/ || $CI_COMMIT_TAG =~ /^\d+[.]\d+[.]\d+[-]\S+$/
Loading