-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Unclear behaviour for save
/load
when using SHA (tag or not)
#5933
Comments
related:
This is a tricky one, as it's not clear what the expected behavior should be, let's consider:
If 3.21 tag no longer points to
|
|
No, we can't reliably verify that, we could only make it possible to tag it locally, regardless of the registry repository. |
I think the second one would make sense - in most cases where you pin a reference to exact tag and digest, I don't think you expect it to change? |
By the way, there might actually be two issues here. The one being what you addressed - consolidating tag and digest. However, I think there is a more fundamental problem in that λ bash test-image.bash "docker.io/library/alpine@sha256:2436f2b3b7d2537f4c5b622d7a820f00aaea1b6bd14c898142472947d5f02abe"
[DBG] Pulling image: docker.io/library/alpine@sha256:2436f2b3b7d2537f4c5b622d7a820f00aaea1b6bd14c898142472947d5f02abe
docker.io/library/alpine@sha256:2436f2b3b7d2537f4c5b622d7a820f00aaea1b6bd14c898142472947d5f02abe: Pulling from library/alpine
Digest: sha256:2436f2b3b7d2537f4c5b622d7a820f00aaea1b6bd14c898142472947d5f02abe
Status: Downloaded newer image for alpine@sha256:2436f2b3b7d2537f4c5b622d7a820f00aaea1b6bd14c898142472947d5f02abe
docker.io/library/alpine@sha256:2436f2b3b7d2537f4c5b622d7a820f00aaea1b6bd14c898142472947d5f02abe
[DBG] Running test with pulled image
If you see this it works!
[DBG] Saving image as tarball
[DBG] Removing image from local Dockerd
Untagged: alpine@sha256:2436f2b3b7d2537f4c5b622d7a820f00aaea1b6bd14c898142472947d5f02abe
Deleted: sha256:9ed449c437bfd0ca00973dbbc086fa310e8f7747d5ce78596ceeea177fdd61c8
Deleted: sha256:ef51dabe17eb47d1dab0ed9b3918da01ca30a862359411c99da4bd814513d07f
[DBG] Loading image from tarball
ef51dabe17eb: Loading layer [==================================================>] 6.961MB/6.961MB
Loaded image ID: sha256:9ed449c437bfd0ca00973dbbc086fa310e8f7747d5ce78596ceeea177fdd61c8
[DBG] Running test with loaded image
docker: Error response from daemon: No such image: alpine@sha256:2436f2b3b7d2537f4c5b622d7a820f00aaea1b6bd14c898142472947d5f02abe
Run 'docker run --help' for more information Even though I pull by the digest, it seems that it is lost when saving the image - also referring by the digest. |
One case, though admittedly it is not the strongest of arguments, is when using a version manager - e.g. Renovate [link]. |
Now that I think about it, the problem with consolidating tag and digest is not that big a problem. The actual issue is the behaviour of |
Description
I will often save my Docker images in a gzipped tar file, in order to load them in a different environment.
Then recently I added checksums along with my tags, in order to pin my versions, while having a version manager update to the latest SHA for the given tag.
This combination is causing issues though.
Actually, using the SHA alone causes this not to work in the same way as using the combination.
AFAICT only the tag alone works.
Reproduce
I have a simple script to reproduce this:
Expected behavior
I expected
docker pull
to include a reference using the provided tag, even though it is actually pulling via the SHA.docker version
Client: Docker Engine - Community Version: 28.0.1 API version: 1.48 Go version: go1.23.6 Git commit: 068a01e Built: Wed Feb 26 10:41:16 2025 OS/Arch: linux/amd64 Context: default Server: Docker Engine - Community Engine: Version: 28.0.1 API version: 1.48 (minimum version 1.24) Go version: go1.23.6 Git commit: bbd0a17 Built: Wed Feb 26 10:41:16 2025 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.7.25 GitCommit: bcc810d6b9066471b0b6fa75f557a15a1cbf31bb runc: Version: 1.2.4 GitCommit: v1.2.4-0-g6c52b3f docker-init: Version: 0.19.0 GitCommit: de40ad0
docker info
Additional Info
I tried both with and without the company mirror for Docker Hub to no avail.
The text was updated successfully, but these errors were encountered: