Registry node
docker pull registry #下载registry镜像
mkdir -p /home/registry #宿主机创建registry目录
docker tag registry:latest registry:1.0 #为本地镜像添加新标签
docker run -d -p 5000:5000 --privileged=true -v /home/registry:/var/lib/registry registry:1.0 #启动并挂载目录
Master node
docker pull docker.io/centos #下载centos镜像
docker tag docker.io/centos:latest centos:1.0 #为本地镜像添加新标签
vim /etc/sysconfig/docker
OPTIONS='--selinux-enabled --insecure-registry 192.168.1.244:5000'
ADD_REGISTRY='--add-registry 192.168.1.244:5000'
service docker restart
docker push centos #上传镜像
curl -X GET http://192.168.1.244:5000/v2/_catalog #查看私有仓库上的镜像信息
curl -X GET http://192.168.1.244:5000/v2/centos/tags/list
docker pull 192.168.1.244:5000/centos:1.0
网友评论