启动带认证的https docker容器

docker run -d -p 5000:5000 --restart=always —name registry \
-v /root/auth:/auth \
-e “REGISTRY_AUTH=htpasswd” \
-e “REGISTRY_AUTH_HTPASSWD_REALM=ylzf_realm” \
-e REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd \
-v /home/docker-registry:/var/lib/registry \
-v /home/tools/https-cert:/certs \
-e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/docker.crt \
-e REGISTRY_HTTP_TLS_KEY=/certs/docker.key \
registry

docker registry生成账号密码

docker run --entrypoint htpasswd registry -Bbn zk zk123 > auth/htpasswd

文档更新时间: 2018-06-14 06:54   作者:sign