Aged 17th-century pamphlet illustration of persistent container storage and retention caskets

A Local Docker Registry That Survives a Reboot

Working offline, navigating corporate proxies that intercept TLS, or verifying whether a mirror configuration resolves correctly requires a container registry that you control. Docker provides an official container image for this, registry:2, which spins up a working registry with a single command: docker run -d -p 5000:5000 registry:2. However, running the container naively stores everything inside its writable layer, wiping your cached images the moment the container is removed. On top of that, standard docker tag behaviour makes it easy to accidentally overwrite images when pushing multiple versions. To solve these issues, I wrapped registry:2 in a small shell script, local-docker-registry. Here is how to handle persistence, avoid image clobbering, query the underlying HTTP API, and catch configuration drift. Persistence and Container Lifecycle Running the official registry image locally is straightforward: ...

August 24, 2026 · 6 min · 1150 words · me@krismade.me