-
Notifications
You must be signed in to change notification settings - Fork 540
How to get one multi-platform image with separated dockerfiles? #272
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
Comments
You can't do this with a single build command invocation, but you can join the separate images together with https://github.com/docker/buildx#buildx-imagetools-create-options-source-source Note that if you would use a single Dockerfile, different platforms can point to different stages in that Dockerfile, eg. like https://github.com/moby/buildkit/blob/99b2abfb76607caa04418c1b097709b3df829287/Dockerfile#L216 |
Thank you! |
@tonistiigi: is this only for images that already exist at a remote registry (like DockerHub)? I'm having trouble coming up with a command that takes local images I have and produce a multi-arch manifest. I would like to not end up with Dockerfile-amd64
Dockerfile-armv7
The only way I can get buildx to support my use case is to have instead of this ..:
.. have this:
And have a single Dockerfile like this:
While this would work, it seems like a hack and should I ever need to customize something by architecture, I'd need separate Dockerfiles anyway.. |
|
You can use |
@tonistiigi wow, those were some really good tips, thanks! Awesome. Short, to the point and exactly what I asked. 👏 It was somewhat hard even finding the One more question, it's great that "Docker push by digest" search term yields practically nothing, and https://docs.docker.com/engine/reference/commandline/push/ makes it seem it's not available since the doc page for pull lists digest as optional. |
No, |
@tonistiigi ok, thank you so much for all your informative answers! |
@tonistiigi How can I obtain information (eg. digest hash value) about the manifest that was pushed using |
I need to use separate dockerfiles for different platforms, but want to see a result as one multi-platform image.
I try to use bake file:
but seems it first push x64 single platform image, then overwrite it with two-platform arm image.
Is it possible to get one tri-platform image with 2 different dockerfile?
The text was updated successfully, but these errors were encountered: