0

I run server with ubuntu 17.04. I decided to try docker for my new project. I realized that docker does not play nicely with firewalls because it alters iptables on its own. So I browsed docker docs and found out that you can prevent that from happening by creating json file with flag like this:

/etc/docker/daemon.json

{
          "iptables": false
}

However after trying to restart the docker daemon I ran into an error:

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

More 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'.


The other output:

-- 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'.


Does anybody know how to fix this?

EDIT:


After running dockerd -D command output looks like this:

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


5
  • Run docker daemon -D and see what error do you get? Sep 26, 2017 at 19:10
  • @TarunLalwani the command returns this invalid character 'Ã' looking for beginning of object key string
    – maranovot
    Sep 26, 2017 at 20:59
  • Please change the content to {"iptables": false}. No spaces, no newlines. and try again Sep 26, 2017 at 21:03
  • @TarunLalwani it seems to be stuck on line INFO[0001] API listen on /var/run/docker.sock
    – maranovot
    Sep 26, 2017 at 21:15
  • Try sudo docker ps in another terminal. The command I gave you will not end or go to background. If it is stuck there then that means it is working. Once docker ps works you can close this and try again with the service command service docker start Sep 27, 2017 at 5:21

0

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.