21321 发表于 2015-2-6 09:08:52

建立docker私有库(docker registry)

1、使用fedora 20(IP为192.168.1.103)作为测试服务器(centos 7,redhat 7通用)

2、安装docker



[*]yum -y install docker-io docker-registry

特别说明,fedora更新的docker 1.3.1提交到本地库有问题,有1.3.0的docker没问题。若以后再更新版本,按照上面的操作



[*]yum -y install http://mirrors.163.com/fedora/updates/20/x86_64/docker-io-1.3.0-1.fc20.x86_64.rpm


3、启动并保持开机启动,安装docker registry



[*]systemctl start docker
[*]systemctl start docker-registry
[*]systemctl enable docker
[*]systemctl enable docker-registry





[*]docker run -p 5000:5000 registry


4、在线下载centos镜像



[*]docker pull centos

下载完成后执行



[*]docker images


5、将镜像做tag



[*]docker tag img_id localhost.localdomain:5000/centos_local


6、push镜像到本地库



[*]docker push localhost.localdomain:5000/centos_local   




7、客户端下载这个私服的镜像



[*]docker pull 192.168.1.103:5000/centos_local




10、大功告成

页: [1]
查看完整版本: 建立docker私有库(docker registry)