构建docker私有库

Posted cwind

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了构建docker私有库相关的知识,希望对你有一定的参考价值。

前提:
ip:
     172.16.0.9
docker: 
   Version:  18.05.0-ce
 
1下载registry
 docker pull registry
 
2 建库
将库像放到l永久地址
mkdir /opt/data/registry
docker run -d -p 5000:5000 -v /opt/data/registry:/tmp/registry registry
 
3 客户端添加配置
cat /etc/docker/daemon.json
{
  "experimental": true,
  "registry-mirrors": ["https://95duqcml.mirror.aliyuncs.com"],
   "insecure-registries": [ "http://172.16.0.9:5000" ]
}
#重启生效
systemclt restart docker
确认是否生效
docker info
 
4测试上传
docker pull busybox
docker tag busybox 172.16.0.9:5000/busybox
docker push 172.16.0.9:5000/busybox2
 

以上是关于构建docker私有库的主要内容,如果未能解决你的问题,请参考以下文章