#oci #registry #container-image #podman #docker #specification #docker-image

bin+lib container-registry

A minimal implementation of an OCI container registry, usable as crate or binary

5 unstable releases

0.3.1 Aug 14, 2024
0.3.0 Aug 14, 2024
0.2.0 Aug 1, 2024
0.1.2 Jul 29, 2024

#545 in Network programming

Download history 430/week @ 2024-08-16 230/week @ 2024-08-23 186/week @ 2024-08-30 517/week @ 2024-09-06 608/week @ 2024-09-13 675/week @ 2024-09-20 852/week @ 2024-09-27 2092/week @ 2024-10-04 1979/week @ 2024-10-11 1084/week @ 2024-10-18 684/week @ 2024-10-25 1323/week @ 2024-11-01 1199/week @ 2024-11-08 1036/week @ 2024-11-15 390/week @ 2024-11-22 756/week @ 2024-11-29

3,669 downloads per month

MIT license

98KB
2K SLoC

container-registry

The container-registry crate implements a minimal "best effort" container registry suitable for plugging into axum.

Feature set and standard conformity

This crate has been cleaned up and factored out from the small PaaS rockslide, its feature set represents the requirements of said software. While it tries to follow the OCI distribution and manifest specifications, it was primarily written while reverse engineering real requests from podman and Docker, thus while it may violate the specification some ways, it is certain to cover the basic use cases when using either tool.

The core functionality covered by this crate consists of

  • authentication via HTTP basic auth,
  • image uploading via podman or docker,
  • image downloading via podman or docker, and
  • storing container images on the local filesystem.

Dependencies

An image registry cannot exist outside a web framework, unless it were to ship one itself. The framework underlying this crate is axum for now; wile support for other frameworks could be added with reasonable effort, no such work has been done at this time.

Production readiness

The crate has not been thoroughly battle tested in contested production environments, or seen a deep review, so relying on it for mission critical deployments is probably a bad idea. At this point, it should make a reasonable drop-in replacement for other registries that are not publically accessible and can likely fulfill its role in system level tests.

Use as a binary

container-registry includes a bare-bones installable binary that exposes most of its features from the command line. It is automatically built if the bin features is enabled:

cargo install container-registry --features bin

Dependencies

~7–16MB
~200K SLoC