Combining cross-plattform builds with docker multiarch manifest lists

As the title says, I want to combine cross-plattform builds with docker multiarch manifest lists, which sound like a natural fit at first, but I’m stuck anyway.

Some more detail: I’m currently looking into cross-plattform build support, as outlined in the resin_io blog post “Building ARM containers on any x86 machine, even DockerHub” from 2015. Actually I moved on to a solution by monsonnl, which is based on the very same principle, but adds some flexibility. Both approaches create ARM images on my x86 machine that run on a Rapsberry Pi 3 flawlessly.

I’ve read about the multiarch manifest lists for docker that came up at the end of 2017. Basically, if an image name refers to a manifest list, docker figures out which actual image to pull, based on the OS and architecture which it runs on. Obviously, that feature was implemented without resin_io’s cross-plattform builds on mind.

If I perform a build for armv7 on my x86_64 machine, Docker is unaware of the whole emulation layer and will pull the x86_64-variant of multi-arach base images, unless I explicitly define the architecture. But this erases all the benefits of manifest lists, instead of leveraging them.

Am I unaware any existing setting or feature that would help me? Or do you thing this would need a fix in the Docker code base?

(Note: As far as I am concerned, this issue does not involve the resin_io build service at all, since I’m building locally. So I think I can’t use their custom Dockerfile.template mechanism to solve this.)

1 Like