I’ve just experienced this problem, i cannot start / restart docker or docker.service with systemctl command. I’ve just configuring the TCP socket listening in /etc/docker/daemon.json file and all works when i’m manually run the docker daemon, but every time i try to handle the service with systemctl i get the error:
Ubuntu22.04 LTS
Docker version 20.10.18, build b40c2f6
systemd 249 (249.11-0ubuntu3.4)
/etc/docker/daemon.json
{
"hosts": ["unix:///var/run/docker.sock","tcp://localhost:2375"],
"dns": ["8.8.4.4","8.8.8.8"]
}
# not works
sudo systemctl restart docker
> Job for docker.service failed because the control process exited with error code.
> systemd[1]: docker.service: Start request repeated too quickly.
> systemd[1]: docker.service: Failed with result 'exit-code'.
> systemd[1]: Failed to start Docker Application Container Engine.
unable to configure the Docker daemon with file /etc/docker/daemon.json: the >
set 22 17:38:26 systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
set 22 17:38:26 systemd[1]: docker.service: Failed with result 'exit-code'.
set 22 17:38:26 systemd[1]: Failed to start Docker Application Container Engine.
set 22 17:38:28 systemd[1]: docker.service: Scheduled restart job, restart counter is at 1.
set 22 17:38:28 systemd[1]: Stopped Docker Application Container Engine.
set 22 17:38:28 systemd[1]: Starting Docker Application Container Engine...
# works
sudo dockerd
sudo dockerd --debug
2
Answers
[RESOLVED] Exactely, if you configure the /etc/docker/daemon.json configuration file follow the docs:
https://docs.docker.com/engine/reference/commandline/dockerd/
If you configure the hosts fields remove change the ExecStart from the docker.service file > /usr/lib/systemd/system/docker.service
The issue could be that in
/usr/lib/systemd/system/docker.service
there is the line (notefd://
)error: