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

Determinism of layer identifiers #805

Closed
0xf965 opened this issue Jul 24, 2020 · 1 comment
Closed

Determinism of layer identifiers #805

0xf965 opened this issue Jul 24, 2020 · 1 comment

Comments

@0xf965
Copy link

0xf965 commented Jul 24, 2020

Hi,

I understand that the DiffId is the hash of the unzipped layer, and that it is independent of the image,
but, at least in Docker, every time I build the same image, different DiffId are obtained.

Should they be deterministic?

Am I doing or assuming something wrong?

If they are not, why not?

Thanks.

@vbatts
Copy link
Member

vbatts commented Jul 24, 2020

something like docker build --no-cache will have different DiffId's, just for the virtue of timestamps and compiles. This kind of reproducible builds has been historical effort, but is not what we're attempting to solve. Tools like docker do attempt to do some minor reproducible pieces. But as to how different compilers or tools generate the contents of the container, that is not-trivial to solve.

The big determinism is once a layer is built. That unpacking and repacking of the same content is deterministic. Compression can and does mess this up, but at least for the *.tar itself, this should hold true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants