docker registry安装简单命令实现
程序员文章站
2024-03-30 23:57:33
本文计划使用3条命令来运行一个docker registry私服,其实很简单
环境准备:
docker 1.11.2
compose文件docker-compose....
本文计划使用3条命令来运行一个docker registry私服,其实很简单
环境准备:
docker 1.11.2
compose文件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
第一条命令:
docker pull registry:2.5.1
第二条命令:
docker run --entrypoint htpasswd registry:2.5.1 -bbn testuser testpassword > /home/soft/registry/auth/htpasswd
第三条命令:
docker-compose up -d
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!