-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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
docker save - how to make it reproducible? #49068
Comments
The difference between those setups is that your Docker Desktop engine is using the containerd image-store;
The containerd image-store is not yet the default on Linux installations, but on Docker Desktop it's enabled when doing a factory reset (or fresh install) and no images are present. The non-containerd image store is optimised for disk space; it only preserves images in their uncompressed (unpacked) form. When pulling an image from a registry, the compressed layers are extracted and discarded (but information about them is preserved). The distribution (compressed) format of those images is constructed when pushing (or exporting/saving) the image. Part of the information used to construct the distributable format contains timestamps, which causes the digest to differ. The other part is coompression, which is not reproducible (or not guaranteed to be reproducible). The containerd image-store preserves images both in the "distribution" format (OCI image with compressed layers), and the "unpacked" (extracted) form. Doing so preserves the digest of images that were pulled from a registry, and (for image built locally) performs the compression once, but at the cost of more storage used for storing images (they're stored twice; once in the distributable, compressed, format, and once extracted). You can configure the daemon to use the containerd image store, but if possible, I recommend doing so from a clean state (no images, containers present) because both stores use a different location for storing the data, and switching stores does not remove the data from the other store (so you may end up having data on disk that's not accessible while using the other store); more information in the documentation;
|
@thaJeztah thank you for the explanation! Apparently, something must have changed in docker binaries in the last year or so -- we've been using the same setup (as code, in Ansible) for last few years ( From the documentation it seems that overlay2/fs still seems to be recommended, and that containerd is still 'experimental'. Is that correct understanding? |
Thanks for the extra context Hmm.. so I wonder if that's the same issue as is reported in this ticket (wrong repository as it's not an issue on the CLI itself, but GitHub doesn't allow moving tickets between orgs 😅); There's a pending PR for that issue, but I'd have to check up if it's already complete; |
The output of
docker save
doesn't seem to be reproducible in some cases.On my Mac:
However, when doing the same on a RHEL9 VM host, I get a different output file each time:
I remember testing the same thing on the same VM earlier this year (when on RHEL 9.2/9.3 i think, and some earlier Docker version) and there was no difference in
docker save
output. What's causing this difference? Is there a way to make the output reproducible?The text was updated successfully, but these errors were encountered: