Show HN: Self-hosted Docker image registry. One container, two simple accounts
Hacker News

Show HN: Self-hosted Docker image registry. One container, two simple accounts

  • One container, one port, one data folder. Back up ./data and keep your deployment configuration and credentials with it.
  • Simple users that match how you work. Two accounts, and exactly that much.
  • See what you have. A web page lists tagged images by repository and previews deletes before you confirm.
Account Can do
🔑 push Read images, publish images, delete tags in the web page
👀 pull Read images only. Leave PULL_PASSWORD unset to skip it and allow anonymous pulls

Built on the CNCF Distribution registry behind Nginx. Works with plain docker login, push, pull and Compose.

Quick Start

docker-compose.yml:

services:
  registreasy:
    image: ghcr.io/dellarb/registreasy:latest
    restart: unless-stopped
    ports:
      - "${BIND_ADDRESS:-127.0.0.1}:${PORT:-5000}:5000"
    environment:
      PUSH_PASSWORD: "replace-with-a-long-random-push-password"
      PULL_PASSWORD: "replace-with-a-long-random-pull-password" # omit to allow pulls with no password
    volumes:
      - ./data:/data

Replace each example password with a different random secret.

docker compose up -d

The quick start binds to 127.0.0.1, so only clients on the registry host can connect. For pulls and pushes from another machine on a trusted LAN or VPN, set BIND_ADDRESS in the Compose project's .env to the registry host's LAN or VPN IP (for example, 192.168.1.10) and run docker compose up -d. Set PORT in the same file if you want a host port other than 5000. Use that IP and port on the client.

With plain HTTP, add the endpoint to the client's Docker insecure-registries setting and restart Docker.

Push and Pull

Only the push account can publish.

docker pull alpine:3.22
docker tag alpine:3.22 localhost:5000/example/alpine:demo
docker login localhost:5000 -u push
docker push localhost:5000/example/alpine:demo
docker logout localhost:5000
docker image rm localhost:5000/example/alpine:demo
# Omit this login when PULL_PASSWORD is unset.
docker login localhost:5000 -u pull
docker pull localhost:5000/example/alpine:demo

Docker keeps one login per hostname, so a docker login -u push and a docker login -u pull overwrite each other. Pushing needs the push login; pulling needs whichever account your PULL_PASSWORD setting requires.

Replace localhost:5000 with your host and port. Images are stored under the repository name you choose, here example/alpine.

Web Inventory

Open the web inventory http://[yourhost]:5000 and sign in. The pull account provides a read-only view when configured. The push account can preview and confirm tagged-image deletes.

Routine deletes leave the registry online. In Settings, the push user can run offline garbage collection on demand or enable a daily window. See maintenance and recovery for downtime, backups, and rollback.

The registry-size card measures the on-disk total automatically when you open the inventory.

Telemetry

Telemetry is optional and off until a signed-in user opts in (banner or Settings → Privacy & Telemetry); there is also a Feedback button. It is pseudonymous installation telemetry: counts and error categories only, never image names, tags or users, and you can preview exactly what each option sends and turn it off at any time. See telemetry, privacy and feedback.

HTTPS

By default, plain HTTP is accepted only from private addresses (loopback, 10/8, 172.16/12, 192.168/16, 169.254/16, 100.64/10 and IPv6 ULA/link-local). Keep plain HTTP on a trusted LAN or VPN. For anything public, put a TLS proxy in front, bind the registry port to loopback, set REQUIRE_HTTPS=1, and point TRUSTED_PROXY at the proxy's IP so the forwarded client address and scheme are trusted.

/healthz remains available over plain HTTP for monitors, including when REQUIRE_HTTPS=1.

Pull Without a Password

Leave PULL_PASSWORD unset or empty. Anyone who reaches the port can pull every image. Writes and the web page still need a sign-in. Use it only on a LAN or VPN, or behind HTTPS with appropriate access controls.

Configuration

Variable Default Meaning
PUSH_PASSWORD required Push user password
PULL_PASSWORD unset (anonymous pulls) Pull user password; set it to require authenticated pulls
PUSH_USERNAME / PULL_USERNAME push / pull Account names (must differ)
BIND_ADDRESS / PORT 127.0.0.1 / 5000 Compose host bind address and published port
REQUIRE_HTTPS 0 Require HTTPS except for health checks
TRUSTED_PROXY unset IP address of the TLS proxy
TZ UTC Default IANA timezone for scheduled garbage collection; a timezone saved in Settings takes precedence
GC_DRAIN_SECONDS / GC_TIMEOUT_SECONDS 30 / 900 Seconds allowed for each drain wait and for collection, respectively
SESSION_IDLE_SECONDS / SESSION_MAX_SECONDS 1800 / 43200 Web sign-in limits

Build From Source

git clone https://github.com/dellarb/registreasy.git

Set PUSH_PASSWORD in .env and optionally PULL_PASSWORD to require authenticated pulls, then docker compose up -d --build.

Pull requests welcome; see CONTRIBUTING.md. Report vulnerabilities via SECURITY.md. Licensed under the AGPL-3.0; running the unmodified image has no extra obligations.

Read on Hacker News ↗ ← Back to News

Comments

No comments yet. Start the discussion.