Docker搭建私有仓库

起个容器

1
2
3
4
5
6
7
8
9
10
11
registry:
container_name: registry
image: registry
volumes:
- ./registry:/var/lib/registry/docker/registry/v2
- ./registry/auth:/auth
environment:
- REGISTRY_AUTH=htpasswd
- REGISTRY_AUTH_HTPASSWD_REALM=Auth
- REGISTRY_AUTH_HTPASSWD_PATH=/auth
restart: unless-stopped

Auth

1
htpasswd -Bb -c auth(文件名) 用户名 密码