Commit 95cfc969 authored by Kevin Daudt's avatar Kevin Daudt

docker-image: use buildkit to set platform

We build armv7 and x86 images on a 64 bits host in 32 bits mode. Even
though the images are 32 bits, docker still tags them as the host
architecture.

Docker has a way to specify the platform, but requries to enable
experimental features on the daemon, but this is not ideal.

An alternative is using buildkit, which has additional features for
docker. This can be enabled by setting `DOCKER_BUILDKIT` to `1`. So lets
use that so that we can specify `--platform` when running `docker build`.
parent c6c555a0
Pipeline #6412 passed with stage
in 35 seconds
image: alpinelinux/docker-cli:latest
variables:
DOCKER_BUILDKIT: 1
.docker-login: &docker-login |-
[ -z "$DOCKER_PASSWORD" ] && { echo "Please specify \$DOCKER_PASSWORD"; exit 120; }
printf "$DOCKER_PASSWORD" | docker login -u $DOCKER_USER --password-stdin
......@@ -40,6 +43,7 @@ lint:
script:
- >
docker build --no-cache
--platform $DOCKER_ARCH
--build-arg DOCKER_ARCH=$DOCKER_ARCH/
--build-arg ALPINE_ARCH=-$ARCH
-t $CI_PROJECT_NAME:latest-$ARCH .
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment