-
Notifications
You must be signed in to change notification settings - Fork 589
-
Notifications
You must be signed in to change notification settings - Fork 589
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
cannot run image based on sha (specific to local unpushed images) #1802
Comments
➜ ~ snd images
REPOSITORY TAG IMAGE ID CREATED PLATFORM SIZE BLOB SIZE
rabbitmq latest 90c62dd5e5fd 11 hours ago linux/amd64 232.4 MiB 96.9 MiB
➜ ~ snd run 90c62dd5e5fd echo hi
hi
➜ ~ snd run rabbitmq echo hi
hi
➜ ~ snd run rabbitmq:latest echo hi
hi ( |
You are saying I should just give it the digest? No! It cannot be that simple! 🤦♂️ It does get things working (and thank you indeed for that), but should we support @sha256: format? |
what do you mean by supporting sha256 format (e.g., It supports sha256 format, just don't need to explicitly specify the ➜ ~ snd image inspect 90c62dd5e5fd
[
{
"Id": "sha256:3ddcc140fe5c6dda21a48a3fcc99f120f686003106a767fc1279a5dfeac32b54",
"RepoTags": [
"rabbitmq:latest"
],
"RepoDigests": [
"rabbitmq@sha256:90c62dd5e5fdeda5ca57268c2ea7c7a648fed9fd73e7e545bbf36b936842ef4c"
],
....
# full sha256 id
➜ ~ snd run 90c62dd5e5fdeda5ca57268c2ea7c7a648fed9fd73e7e545bbf36b936842ef4c echo hi
hi It's the same for other commands and for docker (when a sha256 id is needed, only the string (or a unique prefix) is needed) ➜ ~ d run 9b0d21eb242c echo hi
hi
➜ ~ d images | grep 9b0d21eb242c
golang 1.19-buster 9b0d21eb242c 4 weeks ago 935MB ( |
|
I may try to solve this~ |
I took a look and it seems that it's because it didn't match during the image walk. The tag was not matched as part of the digest, so it only matches successfully when there is only the tag. I observed that Docker's behavior is as expected. Please pay more attention to |
Thanks for your kind suggestion ~ |
Description
I have standard lima with nerdctl, default image. I load in a simple image:
I try to run the image using the name:tag, that works:
$ nerdctl run --rm -it abc:foo /bin/sh #
It also works using the canonical name:
$ nerdctl run --rm -it docker.io/library/abc:foo /bin/sh #
But it fails if I use the sha, whether with or without the tag:
The hash definitely exists in containerd and nerdctl knows it, e.g.
nerdctl inspect abc:foo
:and:
How do I run it based on hash?
I can replicate it slightly differently if I use an image that is in a registry:
The above is not too bad, if wasteful, when dealing with published images. For images that are not published, i.e. loaded in, it is a failure.
Steps to reproduce the issue
Describe the results you received and expected
It should recognize a local digest before trying to pull.
What version of nerdctl are you using?
Are you using a variant of nerdctl? (e.g., Rancher Desktop)
None
Host information
In lima default:
The text was updated successfully, but these errors were encountered: