-
Notifications
You must be signed in to change notification settings - Fork 546
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
Default "latest" tag does not work when saving an untagged image #890
Comments
Interesting. So If we just call I'm not sure if this would break anything -- @smukherj1 do you remember this at all? You seemed only concerned with hostnames in that issue, not tags, wdyt? |
@jonjohnsonjr yes, |
And of course Docker will happily load it, but then lie about the image name: If trying to use This breaks all kinds of caching and expectations, when trying to move beyond Docker... The workaround for minikube, is to add explicit "docker.io/" and ":latest" to everything. 😔 There are even more elaborate workarounds for this, like the "short names" in podman v3: And we still end up with multiple "latest", so now we need pull policies on when to update. The previous experiment of trying to use digests, worked even worse (forking* this library). * See #703 All we wanted was a simple way to load images into CRI, after first saving them on the host... |
@afbjorklund yeah this is generally frustrating... deviating from docker's behavior anywhere (even with the best intentions) leads to sorrow.
oof
I think we could match docker's behavior here without much fuss, if that would make things simpler?
Indeed it's terrible :/
Yeah...
Interesting -- I'd love to hear more.
I think this is achievable, and I have some ideas that might be relevant, but I'd like to be tactical about this in terms of benefit per unit time spent... if we append I'd love to chat about a better long-term solution if you're interested, though time zones make that difficult... |
Yeah, I think that will fix this particular issue - and then we can have a separate discussion about the rest... $ docker save busybox > busybox.tar
$ docker load < busybox.tar
Loaded image: busybox:latest
$
$ crane pull busybox busybox.tar
$ docker load -i busybox.tar
1dad141bdb55: Loading layer [==================================================>] 766.6kB/766.6kB
invalid tag "busybox" So it needs to provide the default tag (like you said). Then we can handle quirks of other systems separately. $ podman load -i busybox.tar
Getting image source signatures
Copying blob 1dad141bdb55 done
Copying config a77dce18d0 done
Writing manifest to image destination
Storing signatures
Loaded image(s): localhost/busybox:latest
$ sudo ctr images import busybox.tar
unpacking docker.io/library/busybox:latest (sha256:5d043540942a67f5b672d6866b3447d2a301744e563f25ce2ce8f4b5b124c0c0)...done
I think this will be on the roadmap for next year, trying to introduce CRI as a mandatory component in minikube. This will make it necessary to remove some of the assumptions and hardcodings on Docker, that are there now... |
Save an image using tarball.Write with an empty tag, load will fail.
go-containerregistry/pkg/v1/tarball/write.go
Lines 337 to 341 in 6544cb0
Here use tag.String(), but tag.String() uses
original
:go-containerregistry/pkg/name/tag.go
Lines 58 to 60 in 6544cb0
So the default "latest" tag does not work when saving the image.
Sample code:
$ docker load -i ./nginx.img invalid tag "nginx"
The text was updated successfully, but these errors were encountered: