创建daemon.json后,docker服务无法启动

时间:2017-08-30 07:28:28

标签: docker debian virtual-machine daemon

执行以下步骤时会出现以下错误消息

● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2017-08-30 09:21:52 CEST; 13s ago
     Docs: https://docs.docker.com
  Process: 11581 ExecStart=/usr/bin/dockerd -H fd:// (code=exited, status=1/FAILURE)
 Main PID: 11581 (code=exited, status=1/FAILURE)
      CPU: 28ms

Aug 30 09:21:52 debian systemd[1]: docker.service: Failed with result 'exit-code'.
Aug 30 09:21:52 debian systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Aug 30 09:21:52 debian systemd[1]: Stopped Docker Application Container Engine.
Aug 30 09:21:52 debian systemd[1]: docker.service: Start request repeated too quickly.
Aug 30 09:21:52 debian systemd[1]: Failed to start Docker Application Container Engine.
Aug 30 09:21:52 debian systemd[1]: docker.service: Unit entered failed state.
Aug 30 09:21:52 debian systemd[1]: docker.service: Failed with result 'exit-code'.
Aug 30 09:22:00 debian systemd[1]: docker.service: Start request repeated too quickly.
Aug 30 09:22:00 debian systemd[1]: Failed to start Docker Application Container Engine.
Aug 30 09:22:00 debian systemd[1]: docker.service: Failed with result 'exit-code'.
  • 我在VirtualBox上创建了一个新的Ubuntu 64位虚拟机。
  • 然后我使用安装脚本安装docker:https://get.docker.com/
  • 安装成功后,我尝试将守护进程配置为10.0.2.15:2375,以便将其转发到我的主机操作系统
  • 我运行了nano /etc/docker/daemon.json来创建文件
  • 我将以下示例粘贴到其中

    { "debug": true, "tls": false, "tlscert": "/var/docker/server.pem", "tlskey": "/var/docker/serverkey.pem", "hosts": ["tcp://10.0.2.15:2375"] }

  • 然后我跑了service docker restart

  • 正在运行service docker status向我显示上面的消息

1 个答案:

答案 0 :(得分:0)

检查您机器的 docker 版本

docker --version

我遇到了同样的问题,在将 docker 升级到可用的最新版本后它得到了解决。

即使是 docker 官网上的文档也没有提到类似的东西。

升级 docker 后,重新启动 docker

systemctl restart docker

错误将消失,新的更改将开始反映