centos7上搭建docker私有仓库
来源:互联网 发布:release 变量被优化 编辑:程序博客网 时间:2024/06/06 00:58
私有仓库主机(centos7):10.60.34.46
客户机(centos7):client
私有仓库主机上:
下载registry镜像
docker pull registry
运行registry容器,为了在容器关闭时不删除仓库目录,需要把仓库目录挂载到宿主机目录
docker run -d -p 5000:5000 -v /opt/data/registry:/tmp/registry registry
客户机上:
获取一个小的镜像busybox用于测试
docker pull busybox
修改busybox的标签,用于上传到私有仓库
docker tag busybox 10.60.34.46:5000/busybox
上传
docker push 10.60.34.46:5000/busybox
这里会出现错误:
Error response from daemon: unable to ping registry endpoint https://10.60.34.46:5000/v0/v2 ping attempt failed with error: Get https://10.60.34.46:5000/v2/: EOF v1 ping attempt failed with error: Get https://10.60.34.46:5000/v1/_ping: EOF
原因是与私有仓库的默认交互方式是https,而私有仓库主机只提供http服务。可以在客户端docker的启动配置文件中加入参数:-–insecure-registry=10.60.34.46:5000来规避这个问题。
vi /usr/lib/systemd/system/docker.service
[Service]Type=notifyExecStart=/usr/bin/docker daemon -H fd:// --insecure-registry=10.60.34.46:5000
重启docker:
systemctl daemon-reloadservice docker restart
再次上传:
[root@bogon ~]# docker push 10.60.34.46:5000/busyboxThe push refers to a repository [10.60.34.46:5000/busybox] (len: 1)Sending image listPushing repository 10.60.34.46:5000/busybox (1 tags)Image cfa753dfea5e already pushed, skippingImage d7057cb02084 already pushed, skippingPushing tag for rev [d7057cb02084] on {http://10.60.34.46:5000/v1/repositories/busybox/tags/latest}
查看私有仓库:
[root@bogon ~]# curl http://10.60.34.46:5000/v1/search{"num_results": 2, "query": "", "results": [{"description": "", "name": "library/centos"}, {"description": "", "name": "library/busybox"}]}
查询镜像:
[root@bogon ~]# curl http://10.60.34.46:5000/v1/search?q=busybox{"num_results": 1, "query": "busybox", "results": [{"description": "", "name": "library/busybox"}]}
获取镜像:
docker pull 10.60.34.46:5000/busybox
0 0
- centos7上搭建docker私有仓库
- CentOS7搭建Docker私有仓库
- CentOS7搭建Docker私有仓库
- CentOS7搭建Docker私有仓库
- CentOS7搭建Docker私有仓库
- centos7 docker私有仓库搭建
- Docker之Centos7 Docker私有仓库搭建
- centos7 安装docker及搭建私有仓库
- Centos上搭建docker的私有仓库
- Docker搭建私有仓库
- Docker私有仓库搭建
- 搭建Docker私有仓库
- 搭建docker私有仓库
- docker 搭建私有仓库
- 搭建docker私有仓库
- Docker私有仓库搭建
- docker搭建私有仓库
- docker私有仓库搭建
- 第七周项目二建立链队算法库
- 第七周上机实践项目3——负数把正数赶出队列
- 第七周上机实践—项目3—负数把正数赶出队列
- hadoop 文件目录操作
- JAVA--reflect(反射)
- centos7上搭建docker私有仓库
- Eclipse 工程项目报错Target runtime com.genuitec.runtime.generic.jee60 is not defined
- 第四周项目4建设双链表算法库
- 第四周 建立双链表的算法库
- 第四周项目3—单链表应用(2)
- 第七周--负数把正数赶出队列
- 一点一滴掌握WPF应用系列 - 画刷使用(1):SolidColorBrush、LinearGradientBrush、RadialGradientBrush
- ThreadLocal浅析
- 使用Mybatis-Generator自动生成Dao、Model、Mapping相关文件(转)