Docker successfully installed but failed to start

After the Docker installation is successful, the startup error:

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

View the details and the error message is as follows

 Failed to start Docker Application Container Engine.

After testing various methods, the following are confirmed to be effective:

Modify the docker file, the specific command: vi /etc/sysconfig/docker, add = false after --selinux-enabled. You can start successfully:

At this time, the download image may have the following errors or very slow:

Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

 It should be due to domestic network problems. We may need to configure an accelerator to solve it. You can use NetEase's mirror address: http://hub-mirror.c.163.com.

Solution: modify the configuration file vi /etc/docker/daemon.json

Add the following

{
  "registry-mirrors": ["http://hub-mirror.c.163.com"]
}

Reload the docker configuration file

systemctl daemon-reload

Restart docker

systemctl restart docker

Guess you like

Origin blog.csdn.net/liushulin183/article/details/96430595