-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Propagate architecture and os from base to target images #1564
Conversation
@@ -172,6 +172,28 @@ public void setCreated(@Nullable String created) { | |||
this.created = created; | |||
} | |||
|
|||
/** | |||
* Set the architecture for which this container was built. See the <a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Sets (same for setOs
javadoc)
...core/src/main/java/com/google/cloud/tools/jib/image/json/ContainerConfigurationTemplate.java
Outdated
Show resolved
Hide resolved
jib-core/src/test/java/com/google/cloud/tools/jib/image/ImageTest.java
Outdated
Show resolved
Hide resolved
I don't think there is a need to change the arch/os. If they wanted a different arch/os, they should use the image with the arch/os they want. For example, Now that said, I think now this PR undermines reproducibility, just a bit. That is, when the base image is |
Actually, I'm not sure if this is the case with Jib. OTOH, I believe Docker build automatically pulls in the matching os/arch. |
I don't think it undermines reproducibility: we propagate the os/arch from the base image. Docker Hub doesn't silently remap between architectures, so we should get the same base image for the same image ref. I can totally get that But we should document the difference. |
Ah, OK. That makes sense. |
architecture
andos
fields toImage
/ImageBuilder
andContainerConfigurationTemplate
, defaulting to currentamd64
/linux
ImageToJsonTranslator
andJsonToImageTranslator
to propagatearchitecture
/os
BuildImageStep
to propagatearchitecture
/os
from the base image to the built imagewasm/js
to ensure we're not just picking up the defaultamd64/linux
s390x/openjdk:11-stretch
Note that this PR does not expose any facilities for changing the arch/os. I'll leave that to a separate PR.
Fixes #1547