{"id":20181940,"url":"https://github.com/devteds/e2-setup-private-docker-registry","last_synced_at":"2025-04-10T05:10:40.015Z","repository":{"id":132073103,"uuid":"78992069","full_name":"devteds/e2-setup-private-docker-registry","owner":"devteds","description":"Setup private docker registry using docker machine - https://devteds.com/episodes/2-setup-private-docker-registry-secure-with-ssl-password","archived":false,"fork":false,"pushed_at":"2018-10-26T22:40:07.000Z","size":7,"stargazers_count":14,"open_issues_count":0,"forks_count":16,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-24T06:22:24.008Z","etag":null,"topics":["digitalocean","docker","docker-compose","docker-machine","docker-registry","free-ssl","free-ssl-certificates","nginx","private-docker-registry","security","ssl-certificates"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devteds.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-15T03:20:49.000Z","updated_at":"2022-02-21T11:17:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"77818cc9-49ba-4014-929d-8142557fe066","html_url":"https://github.com/devteds/e2-setup-private-docker-registry","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devteds%2Fe2-setup-private-docker-registry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devteds%2Fe2-setup-private-docker-registry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devteds%2Fe2-setup-private-docker-registry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devteds%2Fe2-setup-private-docker-registry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devteds","download_url":"https://codeload.github.com/devteds/e2-setup-private-docker-registry/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248161274,"owners_count":21057555,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["digitalocean","docker","docker-compose","docker-machine","docker-registry","free-ssl","free-ssl-certificates","nginx","private-docker-registry","security","ssl-certificates"],"created_at":"2024-11-14T02:37:10.578Z","updated_at":"2025-04-10T05:10:40.007Z","avatar_url":"https://github.com/devteds.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# README\n\nDevteds [Episode #2](https://devteds.com/episodes/2-setup-private-docker-registry-secure-with-ssl-password)\n\nLearn how to setup a private secure docker registry in the cloud.\n\n[Episode video link](https://youtu.be/KMldBtbJ4qI)\n\n[![Episode Video Link](https://i.ytimg.com/vi/KMldBtbJ4qI/hqdefault.jpg)](https://youtu.be/KMldBtbJ4qI)\n\nVisit https://devteds.com to watch all the episodes\n\n## Tested on\n\n* Mac OSX - 10.10.5\n* Docker - 1.12.1\n* Docker compose - 1.8.0\n* Docker Machine - 0.8.1\n* Ubuntu 16.x (Droplet on Digitalocean)\n\n## Instructions / commands\n\nLogin to digitalocean.com, sign up for an account if you don't have one already, generate ACCESS_TOKEN and save\n\n### Create VM / Droplet on DigitalOcean\n```\nmkdir ~/projects/private-registry\ncd ~/projects/private-registry\n\ndocker-machine create -d digitalocean --digitalocean-access-token=\u003cACCESS_TOKEN\u003e my-private-registry\n\n# Get the SERVER IP ADDRESS using,\ndocker-machine ip my-private-registry\n```\n\nIf you don’t have a DigitalOcean account, [Register now](https://m.do.co/c/a9b9aef156d6) and get some credit and that should get you running a VM of about 2 months (promo as of 10/30/16) - https://m.do.co/c/a9b9aef156d6\n\n### Configure \u0026 Run Services\n\n```\n# create nginx root \ndocker-machine ssh my-private-registry mkdir /root/nginx-root\n\n# create/copy basic nginx.conf,\ndocker-machine scp nginx.conf my-private-registry:/root/nginx-root/\n\n# create/copy an index.html file,\ndocker-machine scp index.html my-private-registry:/root/nginx-root/\n\n# create docker-compose.yml for nginx service. and,\neval $(docker-machine env my-private-registry)\nenv | grep DOCKER\n# verify the docker host which should be pointing to the public IP Address of the my-private-registry\ndocker-compose start\n\n# Verify nginx on http://\u003cSERVER IP ADDRESS\u003e/ and that should work\n\n# Pick a domain name - free ones, buy one, sub domain off of an existing one or if you have a spare\n# Set the A record pointing to the SERVER IP ADDRESS\n\n# Verify nginx using http://\u003cDOMAIN NAME\u003e/ and that should work\n\n# Add registry service to docker-compose.yml\n# Update nginx to define upstream for registry service\ndocker-compose stop\ndocker-machine scp nginx.conf my-private-registry:/root/\ndocker-compose start\n\n# Verify registry http://\u003cDOMAIN NAME\u003e/v2/_catalog and that should work\n\ndocker-compose stop\n\nmkdir certs\n# Get SSL certificate from sslforfree.com (certificate.crt, ca_bundle.crt \u0026 private.key)\n# Unzip the files into certs folder create server.crt using,\ncat certs/certificate.crt certs/ca_bundle.crt \u003e certs/server.crt\n\ndocker-machine ssh my-private-registry mkdir /root/certs\ndocker-machine scp certs/private.key my-private-registry:/root/certs/\ndocker-machine scp certs/server.crt my-private-registry:/root/certs/\n\n# Update nginx to add virtual server for 443 with SSL ON\ndocker-machine scp nginx.conf my-private-registry:/root/\ndocker-compose start\n# or docker-compose up -d\n\n# Verify SSL https://\u003cDOMAIN NAME\u003e/\n\ndocker-compose stop\n# Update nginx to redirect all HTTP to HTTPS\ndocker-machine scp nginx.conf my-private-registry:/root/\ndocker-compose start\n# Verify the redirects\n\ndocker-compose stop\n# Generate htpasswd on the server\n# Update nginx for basic_auth\ndocker-machine scp nginx.conf my-private-registry:/root/\ndocker-compose start\n# Verify basic auth is working\n\n```\n\n\n## Create a dev machine\n\nSwitch to a separate terminal window to create a separate docker machine to test the registry\n\n```\ndocker-machine create -d virtualbox dev1\ndocker-machine ssh dev1\ndocker pull busybox\ndocker login \u003cDOMAIN-NAME\u003e\n# Provide login details\ndocker tag busybox \u003cDOMAIN-NAME\u003e/busybox\ndocker push \u003cDOMAIN-NAME\u003e/busybox\n\n# Verify on http://\u003cDOMAIN NAME\u003e/v2/_catalog\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevteds%2Fe2-setup-private-docker-registry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevteds%2Fe2-setup-private-docker-registry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevteds%2Fe2-setup-private-docker-registry/lists"}