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
docker daemon -D
and see what error do you get?invalid character 'Ã' looking for beginning of object key string
{"iptables": false}
. No spaces, no newlines. and try againINFO[0001] API listen on /var/run/docker.sock
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. Oncedocker ps
works you can close this and try again with the service commandservice docker start