docker 镜像中心搭建

1.由于国外镜像很慢,所以用了网易蜂巢的镜像
docker pull hub.c.163.com/library/registry:2.5.2
本地的存储空间挂载到容器内部,持久保存镜像中心文件
docker run -d -p 5000:5000 -v /opt/data/registry:/tmp/registry hub.c.163.com/library/registry:2.5.2
以上步骤将docker镜像中心启动完成
2.客户机push镜像的时候可能会出现 http: server gave HTTP response to HTTPS client
网上一些解决办法:

在”/etc/docker/“目录下,创建”daemon.json“文件。在文件中写入:

{ "insecure-registries":["192.168.1.100:5000"] }
写入后sudo restart docker 重启失败,提示restart: Job failed to restart
查看docker日志/var/log/upstart/docker.log,发现错误
unable to configure the Docker daemon with file /etc/docker/daemon.json: the following directives are specified both as a flag and in the configuration file: insecure-registries: (from flag: [xx.xxx.xx.xxx:5000], from file: [192.168.1.100:5000])
查询资料以后解决办法为:
vi /etc/default/docker添加DOCKER_OPTS="-H 0.0.0.0:2375 -H unix:///var/run/docker.sock --insecure-registry=192.168.1.100:5000"
保存,重启成功。


转载于:https://www.cnblogs.com/dayangcong/p/7889466.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值