This is a test project to have Docker Hub use Automated builds to deploy both a amd64
and arm32v7
image of a minimal hello-world.
How it works: Docker Hub uses x86_64 machines for all build procedures, inhibiting native compilation of other architectures. By using QEMU in special Dockerfiles meant for other architecture builds and also using manifest-tools to stitch together all of the architecture builds under one release. We can have multiple architecture support just like the official Docker Hub Images.
##How to Replicate
-
Setup Docker Hub with automated builds on push of tags:
####Docker Hub Autobuild Settings
Source Type Source Docker Tag Dockerfile Location Build Context Autobuild Tag /^[0-9.]+/ {sourceref}-amd64 amd64.dockerfile / True Tag /^[0-9.]+/ {sourceref}-arm32v7 arm32v7.dockerfile / True -
a
pre_build
hook will install qemu supportdocker run --rm --privileged multiarch/qemu-user-static:register --reset
-
a
post_push
hook will usemanifest-tools
to generate a collective manifest. -
Push a release tag to the github repo (e.g.
1.1
)
-
Heavy Lifting: ckula's docker-multi-arch-example for being the "base image" of knowledge for this topic.
-
2nd Heavy Lifter: guysoft's post-push hook file for automated releasing based on tags.
-
Micheal Waltz - Cross Building and Running Multi-Arch Docker Images - alternative explanation to ckula's work.
#Caveats:
- Currently you cannot clone the repo on an ARM device and build with either dockerfile due to incompatible base images.
- AdoptOpenJDK images will not work with QEMU / building on amd64. But OpenJDK comes to the rescue with the support. Differences in their underlying images create this difference.