This article plans to use 3 commands to run a Docker registry is actually very simple
Environment Preparation:
Docker 1.11.2
Compose file Docker-compose.yml
Version: ' 2 '
Services:
registry:
image:registry:2.5.1
hostname:registry
ports:
-" 5000:5000 "
Environment:
-tz=" Asia/shanghai "
-" registry_auth=htpasswd "
-" registry_auth_ Htpasswd_realm=registry REALM "
-registry_auth_htpasswd_path=/auth/htpasswd
-Registry_http_tls_ CERTIFICATE=/CERTS/CRTFILE.CRT
-Registry_http_tls_key=/certs/keyfile.key
volumes:
-/home/soft/ Registry/auth:/auth
-/home/soft/registry/certs:/certs
networks:
default:
external:
Name:mynet
First command:
Docker Pull registry:2.5.1
The second command:
Docker run--entrypoint htpasswd registry:2.5.1-bbn testuser testpassword >/home/soft/registry/auth/htpasswd
The third command:
Docker-compose up-d
Thank you for reading, I hope to help you, thank you for your support for this site!