docker 建立私有仓库,24.205为镜像仓库所在主机

一.下载registry
#yum install -y python-devel libevent-devel python-pip gcc xz-devel
#python-pip install docker-registry
 
二.在所有docker宿主机上都执行以下操作
#vi /etc/sysconfig/docker
设置other_args='--insecure-registry 192.168.24.205:5000'
#service docker restart
 
 
三.打开防火墙并启动仓库的容器
#iptables -A INPUT -p tcp --dport 5000 -j ACCEPT
#service iptables save
#docker run -d -p 5000:5000 -v /opt/data/registry:/tmp/registry registry 
 
四.tag并上传镜像
#docker tag d8b514ed80b5 192.168.24.205:5000/centos:tomcat
#docker push 192.168.24.205:5000/centos:tomcat
 
五.下载镜像
#docker pull 192.168.24.205:5000/centos:tomcat
posted @ 2015-01-19 12:37  BiboXie  阅读(244)  评论(0编辑  收藏  举报