containers / image

Work with containers' images
Apache License 2.0
862 stars 375 forks source link

Why do we get the whole image when inspect with docker daemon? #2429

Closed PMExtra closed 4 months ago

PMExtra commented 4 months ago

When I called

skopeo inspect --daemon-host http://a.remote.host docker-daemon:foo:bar

it will send a request to the export an image API (/images/foo/bar/get) which transfers the whole image tarball to the client.

But I think the inspect an image API is enough. It will save lots of traffic.

mtrmac commented 4 months ago

Thanks for reaching out.

The c/image abstraction design does not have an extra “inspect” API. There’s a “get manifest”, and the way docker-daemon: is implemented, that triggers a full, and costly, load and conversion.

docker-daemon: is a transition/compatibility mechanism for moving images to Podman, or to connect Docker’s storage with the c/image conversion pipeline. It not a full-featured client to the Docker Engine API, and due to the inherent serial nature of the export/import APIs, it’s also never going to be as fast as using images in other locations. There’s not that much point in spending a lot of effort to optimize individual aspects of that, it could still not become be as fast as more native alternatives.

PMExtra commented 4 months ago

Thank you for your explanation. Now I understand why this design was chosen. I will consider using both Skopeo and docker-cli to achieve my goals.