Registry nodenode
docker pull registry #下載registry鏡像linux
mkdir -p /home/registry #宿主機建立registry目錄docker
docker tag registry:latest registry:1.0 #爲本地鏡像添加新標籤vim
docker run -d -p 5000:5000 --privileged=true -v /home/registry:/var/lib/registry registry:1.0 #啓動並掛載目錄centos
Master nodecurl
docker pull docker.io/centos #下載centos鏡像url
docker tag docker.io/centos:latest centos:1.0 #爲本地鏡像添加新標籤spa
vim /etc/sysconfig/dockerrest
OPTIONS='--selinux-enabled --insecure-registry 192.168.1.244:5000'io
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