docker registry docker registry安装简单命令实现
人气:0想了解docker registry安装简单命令实现的相关内容吗,在本文为您仔细讲解docker registry的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点:docker,registry,docker,registry安装,docker,registry命令安装,下面大家一起来学习吧。
本文计划使用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
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
加载全部内容