Go to file
2019-07-21 21:06:45 +12:00
2019-07-21 20:52:28 +12:00
2019-07-21 20:52:28 +12:00
2019-07-21 21:06:45 +12:00

docker-qemu-arm

This Debian-based image allows you to easily build cross-platform images. It's been tested with GitLab CI on gitlab.com, but it should work anywhere that docker-in-docker already works, and with a binfmt_misc enabled kernel.

Example Usage

This GitLab example should give you an idea of how to use the image.

Dockerfile

FROM alpine

RUN echo "Hello, my CPU architecture is $(uname -m)"

.gitlab-ci.yml

variables:
  DOCKER_HOST: tcp://docker:2375/

build:
  image: jonoh/docker-qemu-arm
  stage: build
  services:
    - docker:dind
  before_script:
    - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
  script:
    - docker buildx build --platform linux/arm/v7,local --pull -t "$CI_REGISTRY_IMAGE" --push .

And the (partial) output:

#6 [linux/amd64 2/2] RUN echo "Hello, my CPU architecture is $(uname -m)"
#6 0.120 Hello, my CPU architecture is x86_64
#6 DONE 0.3s

#8 [linux/arm/v7 2/2] RUN echo "Hello, my CPU architecture is $(uname -m)"
#8 0.233 Hello, my CPU architecture is armv7l
#8 DONE 0.2s
Description
Docker image with qemu and docker buidx for cross-platform container building
Readme MIT 114 KiB
Release 0.3.0 Latest
2023-11-09 09:11:14 +00:00