Created
September 9, 2018 15:20
-
-
Save max-lt/028b898cfcae30f30755a55786c91507 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
if [ -z "$1" ] | |
then | |
echo "Missing destination file parameter." | |
echo "Usage: $0 path/to/dest" | |
echo "Example: $0 /srv/registry/security/htpasswd" | |
exit 1; | |
fi | |
DEST=$1 | |
echo "Enter the new username:" | |
read -r USERNAME | |
echo "Enter the associated password:" | |
read -rs PASSWORD | |
docker run registry:2 htpasswd -Bbn ${USERNAME} ${PASSWORD} >> $DEST |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
docker run -d \ | |
-p 3443:5000 \ | |
--name registry \ | |
-v /srv/registry/data:/var/lib/registry \ | |
-v /srv/registry/security/htpasswd:/etc/security/htpasswd \ | |
-v /srv/certificates:/etc/certificates \ | |
-e REGISTRY_HTTP_HOST=https://registry.pleem.fr \ | |
-e REGISTRY_HTTP_TLS_CERTIFICATE=/etc/certificates/example.com.crt \ | |
-e REGISTRY_HTTP_TLS_KEY=/etc/certificates/example.com.key \ | |
-e REGISTRY_AUTH=htpasswd \ | |
-e REGISTRY_AUTH_HTPASSWD_PATH=/etc/security/htpasswd \ | |
-e REGISTRY_AUTH_HTPASSWD_REALM="Registry Realm" \ | |
registry:2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment