Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] multi-arch docker images #4151

Open
duncdrum opened this issue Dec 30, 2021 · 3 comments
Open

[feature] multi-arch docker images #4151

duncdrum opened this issue Dec 30, 2021 · 3 comments
Assignees
Labels
docker issues related to our container images enhancement new features, suggestions, etc.

Comments

@duncdrum
Copy link
Contributor

duncdrum commented Dec 30, 2021

to better support arm processors, such as Apple Silicon, but also in cloud. We should produce native images for each platform. While linux/amd64, linux/arm64 are the most important native images we could potentially add more architectures, provided that there is actual demand and use cases for them.

There are two problems preventing us from simply doing so.
The first is that the maven plugin #1267 doesn't support buildx. So for maven to spit out an ARM64 image at all, it needs to run on an ARM chip. There doesn't seem to be an easy way to get our hands on one with the current CI provider.

The second problem is the that changes to the Dockerfile are required. There are architecture specific paths in the builder stage. That being said, all images used by us are already available as multi-arch.

Some more research is necessary, but as of now our options are :

  1. to ditch maven as intermediary for docker on CI, and publish multi-arch images without running on actual ARM chips,
  2. switch CI provider or find a way to use GitHub Actions on ARM for free or,
  3. to replace the current maven-plugin with an alternative plugin that supports v2 manifest files required by buildx,

Happy to hear thoughts and suggestions, but these are in my current order of preference based on work overall feasibility and work required.

@duncdrum duncdrum added enhancement new features, suggestions, etc. docker issues related to our container images labels Dec 30, 2021
@duncdrum
Copy link
Contributor Author

duncdrum commented Dec 31, 2021

some updates: distroless:java images are not published as multi-arch and there are unmerged and closed PRs waiting for over a year to add them, so I m not going to hold my breadth GoogleContainerTools/distroless#606 .

distroless also moved to J11 by default, meaning the J8 images no longer receive updates :-(

However, the distroless:base image is multi-arch (tested) which means we can refactor the Dockerfile to add our desired java (temurin) to it.

@adamretter
Copy link
Member

adamretter commented Jan 2, 2022

Just in case there is any confusion, buildx by itself is not enough to build multi-arch images, ultimately you have the same options regardless of whether you use buildx or not. buildx only provides a nicer CLI for doing so, but doesn't add any magic itself. As per the Docker documentation:

1. Using the QEMU emulation support in the kernel (i.e. only suitable for building from Linux Hosts)
2. Building on multiple native nodes using the same builder instance (i.e. you need hardware)
3. Using a stage in Dockerfile to cross-compile to different architectures

@duncdrum
Copy link
Contributor Author

duncdrum commented Jan 2, 2022

Yup no confusion. Qemu + buildx will give us multi Linux arch. If we also want win, we need to spin up a win instance on top of that on ci.

as for the lack of mgic withou buildx though local builds, those executed via maven (as part of a release for example) cannot produce multi arch images. So that is a problem. To pull the right images in a multi stage build, we also need buildx.

FROM existdb/existdb:5.3.1

…

will only pull linux/amd64 unless buildx is available, not quite magic, but certainly a desirable feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker issues related to our container images enhancement new features, suggestions, etc.
Projects
None yet
Development

No branches or pull requests

2 participants