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

github.com

49 points by dellarb 1 day ago

I wanted somewhere to push my own Docker images and pull them from my other hosts. The registries I tried were either bare cli and complex config file driven or full fruit complex permission based systems.

Registreasy sits in the middle. Set two passwords in Docker Compose: one for the account that pushes images and one for the read-only account your other hosts use to pull them. You can also allow pulls without a password if that suits your setup.

jeffcarter 14 hours ago

If you want something easier to build on, I've built a series of OCI related libraries here: https://github.com/ohseeeye/oci with some examples of how to build a standalone registry here: https://github.com/ohseeeye/registry.

You could easily run this without nginx then. I built this based on years of headaches running distribution at Docker Hub. I'm slowly working to apply some of the performance and configuration changes back to upstream (~50% faster, 90% less allocations, 100% spec compliant) but it's going to take some time.

meander_water 18 hours ago

Why not just use the official docker registry image? -https://hub.docker.com/_/registry

  $ docker run -d -p 5000:5000 --restart always --name registry registry:3
  • gonzalohm 18 hours ago

    I think op is bothered because that just has CLI support. Nowadays everyone is trying to build their own vibe coding it. Which is cool, but shouldn't be shared publicly as a product

    • dellarb 16 hours ago

      Fair call I should clarify I've not vibe coded a registry app - its docker registry and nginx under the hood with config and UI wrapper to make it easier to use.

  • spwa4 17 hours ago

    If you mean inside a company ...

    1) tough to configure and make user accounts on, never mind using centralized auth for a large team

    2) doesn't support security policies or fine grained access control (no-one outside core IT has access to models of type blah ...)

    3) you want 3 things: docker images, VM images (including proprietary software images) and linux package mirrors (that ideally auto-update), python/ruby/even perl package mirrors. Hell now even mirrors of github projects. This gets you one of those.

    4) no web-UI (kind of, there is registry-ui, but it sucks)

    5) you want it multi-tenant. So the marketing department can have one set of images, and the telecom department can have another, and IT ... you see where this is going

    6) you want this as part of a cluster so everything is very fast, always, everywhere

    Now, there is no software that actually has these features, but Nexus and Artifactory have built up a following. They suck, frankly, and don't have these features you want.

  • dellarb 16 hours ago

    Mostly because setting up users and cleaning up images required extensive command line - the https://hub.docker.com/_/registry is the exact server in here just packaged with nginx and some config to allow easier password setup and a basic UI for container management.

aaronbrethorst 1 day ago

You might say that you're keeping it <puts on sunglasses, pretends to be Ted Danson in The Good Place> Registreezy.

In all seriousness, though, this is cool. I've wanted something exactly like this for a while and I'm going to go poke at it.

  • Shadowmist 1 day ago

    Oh, we’re in the bad place.

vasiliyasp 20 hours ago

Am I right that this is a normal Docker registry from the client’s point of view, right? So after docker login registry:5000 -u push I can push/pull exactly like with Docker Hub, and the only special part is the two-account setup on the server side?

  • dellarb 16 hours ago

    Yes 100%. It is just the https://hub.docker.com/_/registry combined with nginx and config/UI so 100% compatible with regular docker push pull like hub once you've done the local login.

    Only note is docker likes https so if not putting behind a https reverse proxy you will need to set up per insecure-registries in your client.

jamesmstone 21 hours ago

I have always thought it should be possible to put an OCI image on a static webhost, but never looked in to it. ie if you put the right files on gihub pages, s3 or similar you could in theory `docker pull` from it. So I am a fan of simple OCI image registry options

linsomniac 1 day ago

This looks nice.

Another option is Zot: https://zotregistry.dev/v2.1.23/

We've been running it for ~4 months and it's worked great; it's a single executable and they give you a systemd unit file to kick it off.

  • vmt-man 22 hours ago

    Thanks, it's a more interesting project than the one OP posted. Golang is faster and more memory-efficient.

  • chaz6 21 hours ago

    The provide installation instructions for bare-metal (using a binary) and kubernetes/helm. It would be nice to also see instructions for docker/podman compose.

  • dellarb 16 hours ago

    Zot is great, but for me it was a bit more complex than I wanted, with JSON configuration, user management and access policies.

    Multi user and permissions go zot for sure - single user is what registreasy is for.

    • linsomniac 9 hours ago

      Well, we came from Nexus... So while I hear what you're saying, in comparison to Nexus, Zot was a breath of fresh air WRT complexity. ;-) This one does look like a really great choice and I probably would have picked it if I were to have made the choice today.

Helmut10001 1 day ago

I use Gitlab CE locally, which also comes with a Container Registry. However, even tuned down via parameters, a minimal Gitlab consumes at least 2-3 GB of memory these days, so having something more lightweight is really good. I transitioned all my CI&CD jobs to my internal network, behind VPN, and it makes maintaining and deploying websites really effortless and efficient, without the security implications of running Gitlab in the open.

  • duskwuff 1 day ago

    Forgejo and Gitea can also host OCI registries, and are much lighter to run than Gitlab.

  • roygbiv2 23 hours ago

    I'm very surprised at the amount of resources gitlab uses, I'll admit I haven't done any tuning on it though.

  • philipp-gayret 22 hours ago

    Having hosted Gitlab for a large org, I can reveal Gitlab is mostly open source projects glued together with a Gitlab sticker on it. At the time I hosted it, the container registry was Harbor, from https://goharbor.io . I wouldn't call it lightweight personally, as it consists of 10+ of these applications.

  • dellarb 16 hours ago

    For sure - idle ram here is about 42MB for context although its just a container registry not full fruit gitlab type product.

import 1 day ago

Very curious what makes this one different than zot and oci registry.

  • dellarb 16 hours ago

    Zot is great if you need the full features definitely recommend. But JSON based config and extensive user controls when I just needed a secure registry drove me to find this spot in the middle. This is up and running with users working in 60 seconds.

q2dg 23 hours ago

Having to run it via Docker Compose is a no-go for me: I use Podman

  • xx_ns 22 hours ago

    I don't see any indication that it requires compose. The (fairly simple) compose file seems to be provided for ease of use but nothing is seemingly stopping you from running it with podman.

    • justsomehnguy 22 hours ago

      Compose there is only to build the image from the Dockerfile. Guess GP is too opinionated.

  • seedie 22 hours ago

    Is there a reason why `podman compose` doesn't work? Are there functional differences?

  • dellarb 16 hours ago

    Compose is just for ease of start up. Should work fine with podman also let me know if any issues though.

    podman run -d \ --name registreasy \ -p 5000:5000 \ -e PUSH_PASSWORD="your-push-password" \ -e PULL_PASSWORD="your-pull-password" \ -v ./data:/data:Z \ ghcr.io/dellarb/registreasy:latest

yuzzuwo 22 hours ago

does it clean up old tags

  • dellarb 16 hours ago

    Not automatically but if you visit the web interface you can log in as the push user and delete any tag/repo you like. Just make sure to schedule garbage collection in settings.