报错细节如下

-- Unit docker.service has begun starting up.
Aug 31 17:00:53 zad-test-cluster-data4 dockerd-current[17336]: time="2018-08-31T17:00:53+08:00" level=fatal msg="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: [X.X.X.X:5000], from file: [myregistrydomain.com:5000])\n"
Aug 31 17:00:53 zad-test-cluster-data4 systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Aug 31 17:00:53 zad-test-cluster-data4 systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed

service docker start 失败。

我的环境是ubuntu 16.04

最终发现是/etc/docker/daemon.json 和/lib/systemd/system/docker.service 对insecure-registries的设置冲突。

其中/lib/systemd/system/docker.service 没有直接设置insecure-registries

一次检查 EnvironmentFile,发现其中一个文件

设置了insecure-registries,删除了insecure-registries的设置,除去与daemon.json的冲突即可。

 

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐