docker 镜像的提交与私服使用
1.docker镜像私服
通过docker方式的启动,把磁盘存储挂载在宿主机上/app/docker_registry
docker run -d -v /app/docker_registry:/var/lib/registry -p 5000:5000 --restart=always registry
测试检查,http://192.168.2.30:5000/v2/_catalog
网上大部分用的v1协议,现在新版本用v2协议版本。
http://blog.csdn.net/ztsinghua/article/details/51496658,协议详情。
2.通过私服commit交镜像和pull镜像
强制使用某一个地址镜像
more /etc/sysconfig/docker
# /etc/sysconfig/docker
#
# Other arguments to pass to the docker daemon process
# These will be parsed by the sysv initscript and appended
# to the arguments list passed to docker -d
#other_args=
other_args="--insecure-registry 192.168.2.30:5000"
提交镜像:
docker tag 6e6e2f7096a2 192.168.2.30:5000/centos-tomcat:1.0
docker push 192.168.2.30:5000/centos-tomcat:1.0
docker pull 192.168.2.30:5000/centos-tomcat:1.0