-
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
--reproducible leads to different layers in resulting image #900
Comments
Having the same issue. I ran all checks supplied by container-diff, but it didn't reveal any differences. Yet, sha256 still differs.. |
As mentioned in #710 I have already debugged this and the different hash is resulting from the different order of the files in this tar-gz json diff layer information. I think the files listed in that JSON file need to be in a consistent order. |
This map in |
Why is this influenced by caching? I had a look on the code - I am not a Go expert but do those maps preserve order? Wouldn't it be sufficient to just sort the resulting array of files in lexicographical order? |
There is still a case that leads to different layers that I observed today in one of our builds:
The code should be quite easy to fix by adding sorting for the whiteouts. |
Issue is still present. More over, when using --reproducible option and destination gcr - it creates an images with different sha256 digests and created date of Jan 1, 1 that is not really good. |
@androidkh tracked by #2005 |
Actual behavior
Building an image twice using the
--reproducible
flag leads to different layers in the final images.Expected behavior
Image layers should have the same hash as the content is the same and the reproducible flag was used.
To Reproduce
Layers in myrepo.com/img:foo and myrepo.com/img:bar have different hashes.
Additional Information
see steps to reproduce
also described this in in #710 - this issue is however not releated to caching
Triage Notes for the Maintainers
--cache
flagThe text was updated successfully, but these errors were encountered: