Deploying a private docker registry
Deployment testing
- tags
- docker
- caddy
- caddy-docker-proxy
Contents
I wanted to see how hard it was to deploy my own docker registry. It's not that hard and we have the benefit of living in our own little eco system. Here's the final script to deploy a private registry server on a stock debian/Ubuntu instance. Lets walk through it.
Deploy the registry container
The idea is that you copy this script over to the remote machine and run it. We setup a couple of things
- First check to see if
dockeris installed, and install it if not.
| |
Caddy
We are going to use caddy-docker-proxy as our main webserver. This
will watch the host system for docker containers that contain the
caddy label, and automatically configure Caddy to serve them up. We
also get https out of this so that's cool.
- Create the network
caddyif it doesn't exist - Create
caddy_dataandcaddy_configso certs and other things survive containers - Finally, start up the
caddycontainer itself.
| |
Registry container
Now on to the registry itself.
registry_datais where the images get storedregistry_authis where the username/passwords live
| |
Copy and run
| |
Basic test
| |
| |
OK, so lets try and log in
| |
| |
Then:
| |
| |
Tag and push
Lets first log into the server and see what's in the registry_data volume.
Server:
| |
Now lets try to actually push something there. We'll pull down
hello-world, tag it with the new name
registry.willschenk.com/hello-world and then push it.
Client:
| |
Now back on the server:
| |
We've gone from 4.0K to 148K so something happened!
And if we check over the api itself:
| |
| |
Notes
- Right now
registry.willschenk.comspecified at the top of the file - Also you need to change the email address
- Probably want to update that user/password combo
Previously
Next