运行命令journalctl -eu docker,查看错误原因,例如:
root@fitit100_01:~# journalctl -eu docker
May 11 01:34:26 fitit100_01 systemd[1]: Starting Docker Application Container Engine...
May 11 01:34:26 fitit100_01 dockerd[2869]: unable to configure the Docker daemon with file /etc/docker/daemon.json: EOF
May 11 01:34:26 fitit100_01 systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
May 11 01:34:26 fitit100_01 systemd[1]: docker.service: Failed with result 'exit-code'.
May 11 01:34:26 fitit100_01 systemd[1]: Failed to start Docker Application Container Engine.
May 11 01:34:28 fitit100_01 systemd[1]: docker.service: Scheduled restart job, restart counter is at 2.
May 11 01:34:28 fitit100_01 systemd[1]: Stopped Docker Application Container Engine.
May 11 01:34:28 fitit100_01 systemd[1]: Starting Docker Application Container Engine...
May 11 01:34:28 fitit100_01 dockerd[2874]: unable to configure the Docker daemon with file /etc/docker/daemon.json: EOF
May 11 01:34:28 fitit100_01 systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
May 11 01:34:28 fitit100_01 systemd[1]: docker.service: Failed with result 'exit-code'.
May 11 01:34:28 fitit100_01 systemd[1]: Failed to start Docker Application Container Engine.
May 11 01:34:30 fitit100_01 systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
May 11 01:34:30 fitit100_01 systemd[1]: Stopped Docker Application Container Engine.
May 11 01:34:30 fitit100_01 systemd[1]: docker.service: Start request repeated too quickly.
May 11 01:34:30 fitit100_01 systemd[1]: docker.service: Failed with result 'exit-code'.
May 11 01:34:30 fitit100_01 systemd[1]: Failed to start Docker Application Container Engine.
可以看到daemon.json文件有误,修改后重启docker即可。
评论区