docker registry (私有仓库)

首先要导入registry的镜像文件
1.普通的registry
一条命令创建一个仓库
docker run -d -p 5000:5000 --restart=always --name registry -v /opt/myregistry:/var/lib/registry registry

上传镜像到私有仓库
a.给镜像打标签
docker tag centos:6.9 10.0.0.11:5000/centos:6.9

b.上传镜像
docker push 10.0.0.11:5000/centos:6.9

这样的报错:
The push refers to repository [10.0.0.11:5000/nginx]
Get https://10.0.0.11:5000/v2/: http: server gave HTTP response to HTTPS client

解决方法:
[root@docker1 tmp]# vim /etc/docker/daemon.json

{
"registry-mirrors": ["https://registry.docker-cn.com"],
"insecure-registries": ["10.0.0.12"]
}

猜你喜欢

转载自www.cnblogs.com/yangxiaoni/p/11991968.html