$ show psviderski/unregistry
Unregistry is a lightweight OCI-compliant container registry that stores images directly in the local containerd content store. It is designed as a simpler alternative to a full Docker registry, primarily for pushing images to remote Docker daemons over SSH without an external registry. The project includes a Go server binary (cmd/unregistry/main.go) that implements the OCI distribution specification using the Docker Distribution library as a framework, with custom middleware that backs blob, manifest, and tag operations with containerd's content and image stores. A companion Bash script, docker-pussh, acts as a Docker CLI plugin to orchestrate pushing images: it establishes an SSH tunnel to a remote host, starts an ephemeral unregistry container, forwards ports, performs a standard docker push, then cleans up. The codebase is well-structured with clean abstractions, comprehensive error handling, and extensive test coverage including conformance tests against the OCI distribution spec and end-to-end tests using Docker-in-Docker containers. The storage layer in internal/storage/containerd demonstrates a solid pattern for integrating containerd with the distribution registry, handling leases, garbage collection labels, and resumable uploads. The project is actively maintained with recent commits and a responsive issue tracker.
The LLM identified 3 files worth highlighting for reuse:
Implements distribution.BlobStore backed by containerd content store. Provides Stat, Get, Open, Put, Create, Resume, ServeBlob operations. Uses containerd's content API for blob storage and retrieval. Demonstrates how to adapt a content-addressed storage system to the OCI distribution blob interface. The implementation is clean and self-contained, handling blob existence checks, reading, writing, and serving over HTTP. Could be reused as a reference or extracted as a library for other projects needing containerd-backed blob storage.
Implements distribution.TagService using containerd image store. Manages image tags by creating/updating images in containerd with proper garbage collection labels to prevent content deletion. Handles both single-platform and multi-platform images. Demonstrates the correct usage of containerd's image service, GC label propagation via SetChildrenMappedLabels, and dispatch. This is a non-trivial integration pattern that solves the common problem of preventing premature garbage collection of image content.
Implements distribution.BlobWriter for resumable blob uploads to containerd. Uses containerd leases to prevent garbage collection during upload, with configurable expiration. Handles write, commit, cancel, and close operations. Demonstrates proper lease lifecycle management and content writer reuse. This is a well-crafted component that could be extracted as a reusable upload manager for containerd-based storage backends.