NHacker Next on Rails
  • top
  • new
  • best
  • ask
  • show
  • jobs
login
GuidelinesFAQListsAPISecurityLegalApply to YCContact

Hacker News on Rails, powered by React on Rails Pro. Open the source on GitHub by ShakaCode.

Commit 06fc0df

Rendered at 09:04:53 GMT+0000 (Coordinated Universal Time) with Rails + React on Rails RSC.

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

51 points by dellarb 2d ago | 33 comments

jeffcarter 1d 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 1d 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
dellarb 1d 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.
spwa4 1d 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.

gonzalohm 1d 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 1d 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.
modinfo 2d ago
I like your project, simple docker image and we have working Docker registry, Thank you for you hard work! I also build my own registry for npm packages and cargo crates: https://github.com/skorotkiewicz/registry
aaronbrethorst 2d 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 2d ago
Oh, we’re in the bad place.
jamesmstone 1d 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
vasiliyasp 1d 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 1d 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.

linsomniac 2d 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.

dellarb 1d 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 1d 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.
chaz6 1d 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.
vmt-man 1d ago
Thanks, it's a more interesting project than the one OP posted. Golang is faster and more memory-efficient.
Helmut10001 2d 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 2d ago
Forgejo and Gitea can also host OCI registries, and are much lighter to run than Gitlab.
philipp-gayret 1d 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 1d ago
For sure - idle ram here is about 42MB for context although its just a container registry not full fruit gitlab type product.
roygbiv2 2d ago
I'm very surprised at the amount of resources gitlab uses, I'll admit I haven't done any tuning on it though.
firezenk 1d ago
There's a lot of options in this field, why a new one? what makes dellarb different?
import 2d ago
Very curious what makes this one different than zot and oci registry.
dellarb 1d 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 2d ago
Having to run it via Docker Compose is a no-go for me: I use Podman
xx_ns 2d 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 2d ago
Compose there is only to build the image from the Dockerfile. Guess GP is too opinionated.
dellarb 1d 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

seedie 1d ago
Is there a reason why `podman compose` doesn't work? Are there functional differences?
justsomehnguy 2d ago
Then don't run it with Docker Compose.

https://docs.podman.io/en/latest/markdown/podman-compose.1.h...

yuzzuwo 1d ago
does it clean up old tags
dellarb 1d 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.