Skip to content

Instantly share code, notes, and snippets.

@ggotti
Last active May 29, 2017 05:30
Show Gist options
  • Save ggotti/258791f9ccb0a795ded89d62be07b203 to your computer and use it in GitHub Desktop.
Save ggotti/258791f9ccb0a795ded89d62be07b203 to your computer and use it in GitHub Desktop.
Docker-compose file for spinning up a Docker Registry on a Rancher instance.

Docker Registry

Docker-Compose file for creating a basic Docker Registry on a Rancher instance.

  1. Create registry folder: mkdir /registry/
  2. Save credentials
docker run --entrypoint htpasswd registry:2 -Bbn testuser testpassword > auth/htpasswd
  1. Copy docker-compose.yml file into Rancher. Enjoy.
version: '2'
services:
registry:
image: registry:2
environment:
REGISTRY_AUTH: htpasswd
REGISTRY_AUTH_HTPASSWD_PATH: /auth/htpasswd
REGISTRY_AUTH_HTPASSWD_REALM: Registry Realm
REGISTRY_HTTP_TLS_LETSENCRYPT_CACHEFILE: /certs/letsEncrypt.cache
REGISTRY_HTTP_TLS_LETSENCRYPT_EMAIL: <EMAIL HERE>
volumes:
- /registry/data:/var/lib/registry
- /registry/certs:/certs
- /registry/auth:/auth
ports:
- 443:5000/tcp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment