#container-image #api #streaming #github #interact #skopeo #com-containers-image


Interact with the github.com/containers/image library via skopeo

17 releases

0.6.0 Jun 3, 2024
0.5.8 Jan 24, 2024
0.5.7 Sep 27, 2023
0.5.3 May 1, 2023
0.3.2 Nov 30, 2021

#290 in Images

Download history 645/week @ 2024-03-14 570/week @ 2024-03-21 327/week @ 2024-03-28 415/week @ 2024-04-04 605/week @ 2024-04-11 530/week @ 2024-04-18 292/week @ 2024-04-25 415/week @ 2024-05-02 443/week @ 2024-05-09 741/week @ 2024-05-16 375/week @ 2024-05-23 853/week @ 2024-05-30 512/week @ 2024-06-06 711/week @ 2024-06-13 1204/week @ 2024-06-20 795/week @ 2024-06-27

3,366 downloads per month
Used in ostree-ext


465 lines

Rust bindings for accessing the Go containers/image stack

This crate contains a Rust API that forks /usr/bin/skopeo and talks to it via a custom API. You can use it to fetch container images in a streaming fashion.

At the time of this writing, you will need skopeo 1.6.0 or later.


First, assume one is operating on a codebase that isn't Go, but wants to interact with container images - we can't just include the Go containers/image library.

The primary intended use case of this is for things like ostree-containers where we're using container images to encapsulate host operating system updates, but we don't want to involve the containers/image storage layer.

What we do want from the containers/image library is support for things like signatures and offline mirroring. More on this below.

Forgetting things like ostree exist for a second - imagine that you wanted to encapsulate a set of Debian/RPM/etc packages inside a container image to ship for package-based operating systems. You could use this to stream out the layer containing those packages and extract them directly, rather than serializing everything to disk in the containers/storage disk location, only to copy it out again and delete the first.

Another theoretical use case could be something like krustlet, which fetches WebAssembly blobs inside containers. Here again, we don't want to involve containers/storage.

Desired containers/image features

There are e.g. Rust libraries like dkregistry-rs and oci-distribution and similar for other languages.

However, the containers/image Go library has a lot of additional infrastructure that will impose a maintenance burden to replicate:

  • Signatures (man containers-auth.json)
  • Mirroring/renaming (man containers-registries.conf)
  • Support for ~/.docker/config.json for authentication as well as /run


API is subject to change.


~268K SLoC