互联网服务Docker

docker在CentOS7下配置other_args参数未生效

现在环境如下---------------myhost  私有库,安装了docker registry v2  映射到端口 5000host1  docker客户机,安装有docker---------------我现在编辑 host1 的/etc/sysconfig/docker /etc/sysconfig/docker # /etc/sysconfig/docker # # Other...显示全部
现在环境如下---------------
myhost  私有库,安装了docker registry v2  映射到端口 5000
host1  docker客户机,安装有docker
---------------
我现在编辑 host1 的/etc/sysconfig/docker
/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="--insecure-registry myhost:5000"


然后执行
# systemctl start docker

然后我用 host1 去搜索私有库时就报错了:
[root@docker05 bin]# docker search myhost:5000/xxx
Error response from daemon: invalid registry endpoint https://myhost:5000/v0/: unable to ping registry endpoint https://myhost:5000/v0/
v2 ping attempt failed with error: Get https://myhost:5000/v2/: tls: oversized record received with length 20527
 v1 ping attempt failed with error: Get https://myhost:5000/v1/_ping: tls: oversized record received with length 20527. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add `--insecure-registry myhost:5000` to the daemon's arguments. In the case of HTTPS, if you have access to the registry's CA certificate, no need for the flag; simply place the CA certificate at /etc/docker/certs.d/myhost:5000/ca.crt


但是,我在host1用docker -d --insecure-registry myhost:5000 去跑,然后新建另外一个会话去search它又不报这个错了。
所以目前推断就是docker在CentOS7上设置other_args参数并未生效。


另外,还有一个问题。docker的润星日志在哪里看的?容器的日志我知道。但docker的运行日志我找不到在哪里。/var/log/docker也不存在。收起
参与27

查看其它 14 个回答胶东牛国磊的回答

胶东牛国磊胶东牛国磊系统架构师百度游戏
我是说用  INSECURE_REGISTRY='--insecure-registry ' 环境变量,不是other_args
文化教育其它 · 2015-06-30
浏览10347
  • 对的 就是INSECURE_REGISTRY
    2016-01-10
  • 如果是centos7的系统的话,可以直接修改systemd相关的conf文件就能够生效了,就是楼主最后说的解决方案。主要原因是centos6和centos7的初始化管理程序改变了。其实/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 这里说当初始化脚本是sysv格式的时候,这些参数会生效,言外之意,如果是systemd格式的脚本,就不生效了。可以在 /lib/systemd/system/docker.service中添加相关的docker启动参数。
    2016-01-12

回答者

胶东牛国磊
系统架构师百度游戏
擅长领域: 云计算容器Docker

胶东牛国磊 最近回答过的问题

回答状态

  • 发布时间:2015-06-30
  • 关注会员:2 人
  • 回答浏览:10347
  • X社区推广