互联网服务Docker

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

现在环境如下---------------
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

15同行回答

dl528888dl528888系统运维工程师游戏公司
你的docker版本是多少显示全部
你的docker版本是多少收起
互联网服务 · 2015-06-30
浏览7607
dotNetDR_dotNetDR_软件开发工程师电商公司
找到原因了,是因为 /lib/systemd/system/docker.service[Unit] Description=Docker Application Container Engine Documentation=https://docs.docker.com After=network.target docker.socket Requires=docker.socket [Service] EnvironmentFile=-/etc/sysconfig/docker ExecSt...显示全部
找到原因了,是因为 /lib/systemd/system/docker.service
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network.target docker.socket
Requires=docker.socket

[Service]
EnvironmentFile=-/etc/sysconfig/docker
ExecStart=/usr/bin/docker -d $other_args -H fd://
MountFlags=slave
LimitNOFILE=1048576
LimitNPROC=1048576
LimitCORE=infinity

[Install]
WantedBy=multi-user.target
要加EnvironmentFile=-/etc/sysconfig/docker和编辑ExecStart=/usr/bin/docker -d $other_args -H fd://收起
互联网服务 · 2015-07-06
浏览4201
胶东牛国磊胶东牛国磊系统架构师百度游戏
我是说用  INSECURE_REGISTRY='--insecure-registry ' 环境变量,不是other_args显示全部
我是说用  INSECURE_REGISTRY='--insecure-registry ' 环境变量,不是other_args收起
文化教育其它 · 2015-06-30
浏览10349
  • 对的 就是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
zzfzqqzzfzqq系统运维工程师shsg
centos7 上 需要做如下配置:vim /lib/systemd/system/docker.service增加 EnvironmentFile=/etc/sysconfig/docker然后执行 systemctl reload  然后 other_args 就生效了。还有啊。配置的参数生效不生效。简单的 ps -ef |grep docker 进程就可以看出来。不需要...显示全部

centos7 上 需要做如下配置:

vim /lib/systemd/system/docker.service

增加 EnvironmentFile=/etc/sysconfig/docker

然后执行 systemctl reload  然后 other_args 就生效了。


还有啊。配置的参数生效不生效。简单的 ps -ef |grep docker 进程就可以看出来。不需要那么麻烦。

收起
互联网服务 · 2016-01-13
浏览4918
dotNetDR_dotNetDR_软件开发工程师电商公司
回复 13# 胶东牛国磊     我就是用myhost替换为我的ip的,少侠,你有空的话加我qq吧,往后都会有很多docker坑要踏平。。。看私信显示全部
回复 13# 胶东牛国磊


    我就是用myhost替换为我的ip的,少侠,你有空的话加我qq吧,往后都会有很多docker坑要踏平。。。看私信收起
互联网服务 · 2015-06-30
浏览4029
胶东牛国磊胶东牛国磊系统架构师百度游戏
你直接用的myhost???myhost要换成你的registry server的ip地址吧.显示全部
你直接用的myhost???
myhost要换成你的registry server的ip地址吧.收起
文化教育其它 · 2015-06-30
浏览4034
dotNetDR_dotNetDR_软件开发工程师电商公司
回复 11# 胶东牛国磊     试了,不行。。。:'(OPTIONS="--insecure-registry myhost:5000 --selinux-enabled"显示全部
回复 11# 胶东牛国磊


    试了,不行。。。:'(



OPTIONS="--insecure-registry myhost:5000 --selinux-enabled"收起
互联网服务 · 2015-06-30
浏览3992
胶东牛国磊胶东牛国磊系统架构师百度游戏
# /etc/sysconfig/dockerOPTIONS='--insecure-registry=172.30.0.0/16 --selinux-enabled'这个在我的fedora是可以工作的. 你仿照这个改吧,我觉得应该是OPTIONS不是other_args显示全部
# /etc/sysconfig/docker
OPTIONS='--insecure-registry=172.30.0.0/16 --selinux-enabled'

这个在我的fedora是可以工作的. 你仿照这个改吧,我觉得应该是OPTIONS不是other_args收起
文化教育其它 · 2015-06-30
浏览9711
  • 这个文件里面没有options的选项怎么办?是将这个OPTIONS='--insecure-registry=172.30.0.0/16 --selinux-enabled'粘贴在文件的末尾就行吗?
    2016-02-16
  • other_args="--selinux-enabled=true --insecure-registry myhost:5000",centos7试了,问题解决
    2016-02-16
dotNetDR_dotNetDR_软件开发工程师电商公司
回复 9# 胶东牛国磊     求个具体详细格式,那个文件内显示全部
回复 9# 胶东牛国磊


    求个具体详细格式,那个文件内收起
互联网服务 · 2015-06-30
浏览9486
dotNetDR_dotNetDR_软件开发工程师电商公司
回复 7# 胶东牛国磊     试了,还是一样报错,配置如下:other_args="--selinux-enabled=true --insecure-registry myhost:5000"显示全部
回复 7# 胶东牛国磊


    试了,还是一样报错,配置如下:
other_args="--selinux-enabled=true --insecure-registry myhost:5000"
收起
互联网服务 · 2015-06-30
浏览9561

提问者

dotNetDR_
软件开发工程师电商公司
擅长领域: Docker云计算容器引擎

相关问题

相关资料

相关文章

问题状态

  • 发布时间:2015-06-29
  • 关注会员:2 人
  • 问题浏览:34991
  • 最近回答:2016-01-13
  • X社区推广