Running your private docker registry is actually super easy to do, and this blog post shows you how you could achieve this. I am assuming you understand what docker is and docker compose. This example will use nginx in combination with letsencrypt.
Create the following 3 directories: - data - nginx - sslcerts And create a docker-compose.yml file with the following content:
This installs 3 docker containers, nginx, the registry, and a gui to manage your registry. Change yoururl.com to your own definition Your structure should look like:
The next step is to create a username and password for your registry, this file will be read by nginx, and functions as basic auth.
Create an nginx/nginx.conf file with the contents, and change yoururl.com to whatever you want
Next step is setting up letsencrypt for https.
Copy the certificates to sslcerts:
Only one thing left, that is creating a service for your docker file create a file in /lib/systemd/system/docker-registry.service
change the path of /dockerregistry to your specified path. Ready to start up your registry!
Check if your docker registry is working by running doing a docker login
It should request a username and password, as has been defined earlier with the htpasswd. You are now able to push and tag images! Browse to your yoururl.com to see if the repositories created by you. It is usefull to auto renew your ssl certificates with a cronjob that runs letsencrypt and restarts nginx. References: https://www.digitalocean.com/community/tutorials/how-to-set-up-a-private-docker-registry-on-ubuntu-14-04