-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Support multiple targets for docker image tag command #5605
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: MohammadHasan Akbari <[email protected]>
Thanks for contributing! I think this change may need a bit of discussion before we move ahead. The current approach is the equivalent to running
I think ideally this would be resolved on the daemon side, and instead of accepting a single However, we could do an alternative; the good news is tagging also works using the digest of the image; docker pull hello-world
Using default tag: latest
latest: Pulling from library/hello-world
Digest: sha256:d211f485f2dd1dee407a80973c8f129f00d54604d2c90732e8e320e5038a0348
Status: Image is up to date for hello-world:latest
docker.io/library/hello-world:latest
docker image tag hello-world@sha256:d211f485f2dd1dee407a80973c8f129f00d54604d2c90732e8e320e5038a0348 my-image:latest
docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest d211f485f2dd 18 months ago 21kB
my-image latest d211f485f2dd 18 months ago 21kB The alternative here would be for the CLI to resolve the image's digest, then to tag each image using that digest. The image's digest can't change, and if the original image is removed beteen calls, the digest wouldn't be removed (unless all tags referring to it would be removed), so the sequence would be;
However it looks like there's some limitations here;
Tagging the image using its (short) ID fails without the containerd image-store enabled (I'm suspecting the second case may actually be a bug, as it's attempting to use docker image tag d211f485f2dd my-image:latest
Error response from daemon: No such image: d211f485f2dd:latest
docker image tag d211f485f2dd1dee407a80973c8f129f00d54604d2c90732e8e320e5038a0348 my-image:latest
Error response from daemon: No such image: sha256:d211f485f2dd1dee407a80973c8f129f00d54604d2c90732e8e320e5038a0348 So maybe the correct solution would be to move the "multiple tags" to the daemon side 🤔 This is a bit related to the discussion on this ticket; |
Thank you for reviewing. |
- What I did
- How I did it
- How to verify it
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)