basecamp / kamal

Deploy web apps anywhere.
https://kamal-deploy.org
MIT License
11.28k stars 444 forks source link

Easier self-hosting of a private Docker registry #1166

Open hundredwatt opened 7 hours ago

hundredwatt commented 7 hours ago

I assume long term there will be a solution to run the Docker registry on your own server natively via kamal.

Until then, I worked out a short-term solution using an accessory and kamal-proxy trickery: https://nochlin.com/blog/host-your-own-docker-registry-with-kamal-2

The short-term solution still requires credentials for another registry during the setup process (or this can be hacked by setting registry.server to github.com πŸ˜‚ ).

To make the short-term solution easier, would you consider skipping docker login when booting the proxy and accessories?

(I'm happy to work on the above if the maintainers agree this is a good idea)

pingortle commented 6 hours ago

Your workaround using accessories is brilliant! 🀯

I like your idea to simply skip the login with a flag. Would it also suit your needs to have first-class support for deploying a public image? Maybe it's possible today, but I haven't found that feature yet. πŸ€·β€β™‚οΈ

If we could do that I could get rid of my Dockerfile and the bootstrap-with-ngrok hack in my example here: https://gist.github.com/pingortle/040098454af630cc6cf6fa78bed9b018


For context, here are a few related discussions. Just wanted to link them here for discoverability.

hundredwatt commented 5 hours ago

Would it also suit your needs to have first-class support for deploying a public image? Maybe it's possible today, but I haven't found that feature yet. πŸ€·β€β™‚οΈ

It's not possible today unless you can add LABEL service <serice_name> to the public image (or rebuild it yourself with the LABEL) or use my accessory approach, but the latter only supports a single instance.