将iptables设置为false后,Docker无法启动

时间:2017-09-26 16:59:52

标签: ubuntu docker

我使用ubuntu 17.04运行服务器。我决定尝试使用docker来完成我的新项目。我意识到docker不能很好地使用防火墙,因为它可以自行改变iptables。所以我浏览了docker docs并发现你可以通过使用这样的标志创建json文件来防止这种情况发生:

/etc/docker/daemon.json

{
          "iptables": false
}

但是在尝试重新启动docker守护程序后,我遇到了一个错误:

Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.

更多详情:

● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2017-09-26 16:53:35 UTC; 1min 4s ago
     Docs: https://docs.docker.com
  Process: 2450 ExecStart=/usr/bin/dockerd -H fd:// (code=exited, status=1/FAILURE)
 Main PID: 2450 (code=exited, status=1/FAILURE)
      CPU: 26ms

Sep 26 16:53:35 humblefund systemd[1]: docker.service: Main process exited, code=exited, status=1
Sep 26 16:53:35 humblefund systemd[1]: Failed to start Docker Application Container Engine.
Sep 26 16:53:35 humblefund systemd[1]: docker.service: Unit entered failed state.
Sep 26 16:53:35 humblefund systemd[1]: docker.service: Failed with result 'exit-code'.
Sep 26 16:53:35 humblefund systemd[1]: docker.service: Service hold-off time over, scheduling res
Sep 26 16:53:35 humblefund systemd[1]: Stopped Docker Application Container Engine.
Sep 26 16:53:35 humblefund systemd[1]: docker.service: Start request repeated too quickly.
Sep 26 16:53:35 humblefund systemd[1]: Failed to start Docker Application Container Engine.
Sep 26 16:53:35 humblefund systemd[1]: docker.service: Unit entered failed state.
Sep 26 16:53:35 humblefund systemd[1]: docker.service: Failed with result 'exit-code'.


另一个输出:

-- Support: http://www.ubuntu.com/support
-- 
-- Unit docker.socket has begun starting up.
Sep 26 16:53:35 humblefund systemd[1]: Listening on Docker Socket for the API.
-- Subject: Unit docker.socket has finished start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit docker.socket has finished starting up.
-- 
-- The start-up result is done.
Sep 26 16:53:35 humblefund systemd[1]: docker.service: Start request repeated too quickly.
Sep 26 16:53:35 humblefund systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit docker.service has failed.
-- 
-- The result is failed.
Sep 26 16:53:35 humblefund systemd[1]: docker.socket: Unit entered failed state.
Sep 26 16:53:35 humblefund systemd[1]: docker.service: Unit entered failed state.
Sep 26 16:53:35 humblefund systemd[1]: docker.service: Failed with result 'exit-code'.


 有人知道如何解决这个问题吗?

修改

<小时/> 运行dockerd -D命令输出后如下所示:

unable to configure the Docker daemon with file /etc/docker/daemon.json: invalid character 'Ã' looking for beginning of object key string


0 个答案:

没有答案