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
c8d: Adjust "image list" to return only a single item for each image store entry #45967
Conversation
I don't think we should merge this, the current API response might not be backwards compatible for some clients (it is for the docker cli), but at least it gives information about all the images that are pulled/built. This change would hide that information. I think we should hold on while we get the final shape of the multi-platform aware API and a new version of the cli that knows how to show all the information about all the local images. |
Exactly why my proposal was to temporarily show the manifest ID and not the manifest list ID. Also adding the platform to the images list would be a nice way to tell them appart
I agree that it's confusing currently, but I don't agree that this takes us any closer to the end goal. This change is also confusing, building a multi-platofrm image yields only one image in |
That's why it's a multi-platform image. If you want multiple platform images, you would give them a different name. |
…store entry This will return a single entry for each name/value pair, and for now all the "image specific" metadata (labels, config, size) should be either "default platform" or "first platform we have locally" (which then matches the logic for commands like `docker image inspect`, etc) with everything else (just ID, maybe?) coming from the manifest list/index. That leaves room for the longer-term implementation to add new fields to describe the _other_ images that are part of the manifest list/index. Co-authored-by: Tianon Gravi <admwiggin@gmail.com> Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
I went ahead and rebased this, addressed some of the TODOs. Windows failures expected. |
b666b02
to
bddd892
Compare
// TODO we should probably show *something* for images we've pulled | ||
// but are 100% shallow or an empty manifest list/index | ||
// ("tianon/scratch:index" is an empty example image index and | ||
// "tianon/scratch:list" is an empty example manifest list) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yes, was about to ask if we could test this. As these are minimal images, perhaps we could include them in our "frozen images"?
I'm fine with doing that in a follow-up if it's complicated though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if it makes sense to handle this right now.
- It's impossible to pull such image, you can only load it via
docker load
(or going via containerd store directly). - Even if it is loaded, there's nothing that can be done with that image (except removing/pushing it).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! I should read properly, I thought this one also described "multi-arch" image to test. But this was only for the "lots' of emptiness" case.
I mostly meant; we should have a test to verify that multiple arches of an image are properly grouped into a single image when using docker image ls
(i.e., with this PR merged)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Gave this one another spin; docker pull busybox
Using default tag: latest
latest: Pulling from library/busybox
c2bf9493c1bf: Download complete
Digest: sha256:6d9ac9237a84afe1516540f40a0fafdc86859b2141954b4d643af7066d598b74
Status: Downloaded newer image for busybox:latest
docker.io/library/busybox:latest
docker pull --platform=linux/amd64 busybox
Using default tag: latest
latest: Pulling from library/busybox
9ad63333ebc9: Download complete
Digest: sha256:6d9ac9237a84afe1516540f40a0fafdc86859b2141954b4d643af7066d598b74
Status: Image is up to date for busybox:latest
docker.io/library/busybox:latest Before this PR: docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
busybox latest 6d9ac9237a84 5 weeks ago 6.61MB
busybox latest 6d9ac9237a84 5 weeks ago 6.09MB After this PR: docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
busybox latest 6d9ac9237a84 5 weeks ago 6.61MB As a follow-up (?) we should probably look at the |
Good call, I added test and combined the image size. Do we want to merge this as-is and then review the follow up separately? |
This will return a single entry for each name/value pair, and for now all the "image specific" metadata (labels, config, size) should be either "default platform" or "first platform we have locally" (which then matches the logic for commands like
docker image inspect
, etc) with everything else (just ID, maybe?) coming from the manifest list/index. That leaves room for the longer-term implementation to add new fields to describe the other images that are part of the manifest list/index.Refs #45948, #45735 (especially #45735 (comment))