multiarchbuilder
Docker image to build multiarch docker (Docker in docker FTW)
1.7K
The purpose of this project is to build a Multiarch Docker image in a x86/64 CI/CD context.
Here is an example if .gitlab-ci.yml file to compile
image: femtopixel/multiarchbuilder
variables:
DOCKER_HOST: "tcp://docker:2375"
services:
- docker:dind
stages:
- build
build:
stage: build
only:
- master
before_script:
- docker run --rm --privileged multiarch/qemu-user-static:register --reset
- git clone https://github.com/estesp/manifest-tool && cd manifest-tool && make && make install && cd .. && rm -Rf manifest-tool
- git clone https://github.com/computermouth/qemu-static-conf.git && mkdir -p /lib/binfmt.d && cp qemu-static-conf/*.conf /lib/binfmt.d/ && systemctl restart systemd-binfmt.service
- echo "$DOCKER_HUB_PASSWORD" | docker login -u "$DOCKER_HUB_LOGIN" --password-stdin
script:
- make build
With this, your build task in your Makefile will be able to build an image for other architectures without needing to add qemu into your dockerfiles. Here is the magic :
binfmt-support is installed in femtopixel/multiarchbuildqemu is installed in femtopixel/multiarchbuilddocker is installed in femtopixel/multiarchbuildIf you don't have Docker installed yet, you can do it easily in one line using this command
curl -sSL "https://gist.githubusercontent.com/jaymoulin/e749a189511cd965f45919f2f99e45f3/raw/0e650b38fde684c4ac534b254099d6d5543375f1/ARM%2520(Raspberry%2520PI)%2520Docker%2520Install" | sudo sh && sudo usermod -aG docker $USER
Content type
Image
Digest
sha256:98bdb633a…
Size
441.8 MB
Last updated
about 2 years ago
docker pull femtopixel/multiarchbuilderPulls:
151
Last week