Skip to content

Instantly share code, notes, and snippets.

@pavelz
Created January 14, 2017 16:42
Show Gist options
  • Save pavelz/c9390c9d1bafc25c2987dfec7a9cd213 to your computer and use it in GitHub Desktop.
Save pavelz/c9390c9d1bafc25c2987dfec7a9cd213 to your computer and use it in GitHub Desktop.
#!/bin/bash
# get your certs with certbot
# get passwd with 'docker run --entrypoint htpasswd registry:2 -Bbn testuser testpassword > auth/htpasswd'
docker run -d -p 5000:5000 \
-v /etc/docker-registry:/auth \
-e 'REGISTRY_AUTH="htpasswd"' \
-e 'REGISTRY_AUTH_HTPASSWD_REALM="Registry Realm"' \
-e REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd \
-e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/fullchain1.pem\
-e REGISTRY_HTTP_TLS_KEY=/certs/privkey1.pem\
--restart=always\
-v /etc/letsencrypt/archive/docker.arslogi.ca:/certs\
--name registry2 registry:2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment