-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Proposal: add --platform option for COPY --from=(image|context) #5671
Comments
|
AFAIK |
It does |
Thank you! This proposal would still give shorter build instructions, so I would prefer if it's left open for others to comment on |
I don't think we want this though. |
Docs for the feature to which an improvement is proposed: https://docs.docker.com/reference/dockerfile/#copy---from
Currently, if an image or context, containing an image, is supplied into a COPY statement, the platform chosen is either the target platform of the image being built or the only platform that image has.
However, if this image contains for example cross-compilation-relevant assets, it might be desirable to be able to select its platform. For example, if I need to add Go image in this way, I'd pass
COPY --from=golang:1.23 --platform=$BUILDPLATFORM / /gotoolchain
to obtain a toolchain running natively, without emulation, on the build host.This argument is expected to work in the same way as --platform in https://docs.docker.com/reference/dockerfile/#from
Any comments are welcome!
The text was updated successfully, but these errors were encountered: