What should I do if the docker service cannot start normally?

王林
Release: 2020-07-04 17:13:57
forward
6226 people have browsed it

What should I do if the docker service cannot start normally?

Problem restoration:

(Recommended learning: docker tutorial)

The following error occurred when restarting the docker service:

cannot connect to the Docker datemon at tcp://0.0.0.0:2375 is the docker daemon runing?
Copy after login

Solution process:

Restart the network card

service network restart
Copy after login

Restart the computer, and then delete the docker installation package (Note: When doing the following operations, be sure to back up in advance, otherwise you will not be able to docker All data in the container will be lost)

rm -rf /var/lib/docker
Copy after login

Then reinstall docker

sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
sudo yum install docker-ce
Copy after login

To avoid recurrence of the problem, we do the following configuration

Configure DOCKER_HOST

sudo vim /etc/profile.d/docker.sh
Copy after login

Add the following content:

export DOCKER_HOST=tcp://localhost:2375
Copy after login

Make the configuration file effective

source /etc/profile
source /etc/bashrc
Copy after login

Configure startup file

sudo vim /lib/systemd/system/docker.service
Copy after login

Modify the following statement

ExecStart=/usr/bin/dockerd -H unix://
Copy after login

Modify it to:

ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock -H tcp://0.0.0.0:7654
Copy after login

Reload configuration and restart

sudo systemctl daemon-reload
sudo systemctl restart docker.service
Copy after login

View

docker version
Copy after login

What should I do if the docker service cannot start normally?

Problem solved!

The above is the detailed content of What should I do if the docker service cannot start normally?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:cnblogs.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template