-
Notifications
You must be signed in to change notification settings - Fork 2.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
image showing different digests when pulling and pushing #15969
Comments
Hi @amokkara , I think this happens because
I think this should not happen if compression is known so if you pull the pushed image from registry and push it again it should not happen. But @mtrmac can confirm my points better. |
Hi @flouthoc
I am not pushing the image at all here. Just save to tar and load again. Dockerfile:
|
I think in |
Im using digest to verify that the image is not tampered with after pushing to registry or during pushing. |
@mtrmac could you please provide some insight into this behavior , thanks |
i tried with latest version of podman 4.3.0-dev |
This is fundamentally how it works. The digests validate a specific image representation, not some abstract “sameness” of an image. If you want to preserve the digest, you must preserve the original image representation. That means no Use |
@mtrmac thanks for the detailed explanation! Would you by any chance know how docker does this? Any operation on an image doesnt change the digest of the image when using docker. |
That’s just not true; Anyone can get lucky, at a specific time, when the specific compression implementation used during push is exactly the same as the one creating the pulled version, and makes exactly the same compression choices. And that will break when that implementation is updated or chooses to make different choices. |
We have a process where we save image to tar file and load the image from tar file in another machine n push it to a registry of our choice. |
This is not a theory; I have seen digests change on a Docker upgrade. You have a recommendation on what to do instead to get reliable results — as well as enough general pointers about the structure of the problem to decide whether the risk of unexpected breakage is worth it to you. |
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
image showing different digests when i pull it, and later when i push it to a registry, its showing different digests
Steps to reproduce the issue:
pull any image
podman pull busybox:musl
look at the digest of the pulled image
~/aditya-poc/acc/images# podman image list --digests
REPOSITORY TAG DIGEST IMAGE ID CREATED SIZE
docker.io/library/busybox musl sha256:49cbafcd38052e3dd9c92203fb9abcdb7c2f08b4cb5c9dc16ec964be6164619d ba49bb78d342 2 weeks ago 1.62 MB
push the image to registry
podman push busybox:musl /test/podman/busybox:musl1
query the image digest from registry using v2 api
GET : https:///v2/test/podman/busybox/manifests/musl1
digest in responce : sha256:0236a2d4606f27aa8019deaa6ffb84a9f9cc55fd586b3069deb066f513573322
Describe the results you received:
incorrect digest when image is pushed to registry using podman push
Describe the results you expected:
expected digest to remain unchanged after pushing to registry
Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:Output of
podman info
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)
No
Additional environment details (AWS, VirtualBox, physical, etc.):
ubuntu 20.04
The text was updated successfully, but these errors were encountered: