# 下载registry:2,映射文件目录,运行容器
docker run -d -p 5000:5000 --restart=always --name registry -v /opt/docker/registry:/var/lib/registry registry:2
# http 访问,修改/etc/docker/daemon.json,没有则创建
{ "insecure-registries":["114.116.99.98:5000"] }
# 重启docker
systemctl daemon-reload
systemctl restart docker
# 访问
http://114.116.99.98:5000/v2/_catalog
# 推送镜像
docker push 114.116.99.98:5000/hello-world
# 删除registry
docker stop registry && docker rm -v registry
# 安装docker-registry-web
cd /opt/docker
创建hyper/docker-registry-web的配置文件config.yml。
registry: # Docker registry url url: http://IP:5000/v2 # Docker registry fqdn name: localhost:5000 # To allow image delete, should be false readonly: false auth: # Disable authentication enabled: false
# 运行
docker run -it -d --restart=always -p 8080:8080 --name registry-web --link registry -v $(pwd)/config.yml:/conf/config.yml:ro hyper/docker-registry-web
# 访问
http://ip:8080