If the Pagoda panel fails to start docker , first check whether there are official updates , or ask the official
If it is determined that it is not an official problem, then it may be an error in the yum command.
Use command
yum update
If the update fails, it is basically certain that the failure of docker to start is caused by yum dependencies. The prompt is as follows:
yum update failed: rpmdb: BDB0113 Thread/process 2673/140126198814528 failed: BDB1507 Thread died
Clear, execute the following commands step by step, then update yum, and finally try restarting docker
If it still doesn't work, change the source with one click and try reinstalling docker.
Run the following command on the server terminal to install it.
d
But the old version of the Pagoda panel is useless no matter how much you try. The smart command terminal installs it directly.
The following are some practical notes that the author recorded during the process of learning to build docker. I also encountered some pitfalls during the process, but they were all solved. I will record them here for direct reference when building again in the future.
1. First, check the CentOS version to ensure that it is CentOS7 or above and the system kernel is above 3.10——
2. Uninstall the old docker version
3. Install the required dependency packages
sudo yum install -y yum-utils
4. Set up a domestic mirror warehouse
sudo yum-config-manager \
--add-repo \
http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
5. Update the yum package index
yum makecache fast
6. Install docker-related docker-ce community docker ee enterprise version
sudo yum install docker-ce docker-ce-cli containerd.io
7. Start docker
systemctl start docker
At this time, a very strange exception occurred:
Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.
Don’t panic, let’s check the daemon.json file format first:
vim /etc/docker/daemon.json
I found that the daemon.json file looks like this, and I don’t know why it is missing some characters after updating and downloading it directly...
It needs to be modified like this, that’s it
{"registry-mirrors": ["http://9600955f.m.daocloud.io"],
"insecure-registries": []
}
Next, you can start docker normally——
[root@192 opt]# systemctl daemon-reload
[root@192 opt]# systemctl start docker
If no error is reported, enter systemctl status docker.service. If the following information is displayed, the installation is started and the startup is successful:
After successful installation, when using docker version, the following information will generally appear:
When trying to pull down hello-world, a timeout problem occurred:
[root@192 opt]# docker run hello-world
Unable to find image 'hello-world:latest' locally
docker: Error response from daemon: Get "https://registry-1.docker.io/v2/library/hello-world/manifests/sha256:393b81f0ea5a98a7335d7ad44be96fe76ca8eb2eaa76950eb8c989ebf2b78ec0": net/http: TLS handshake timeout.
See 'docker run --help'.
At this time, you need to change the information in the daemon.json file to the domestic Alibaba Cloud image configuration, which can improve the pulling speed and avoid timeout problems, as follows:
{"registry-mirrors": ["https://6kx4zyno.mirror.aliyuncs.com"],
"insecure-registries": []
}
Then, restart systemctl restart docker.
[root@192 opt]# sudo systemctl restart docker
and try to execute docker run hello-world again. This time it works fine:
[root@192 opt]# docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
2db29710123e: Pull complete
Digest: sha256:393b81f0ea5a98a7335d7ad44be96fe76ca8eb2eaa76950eb8c989ebf2b78ec0
Status: Download ed newer image for hello- world:latest
Hello from Docker!
This message shows that your installation appears to be working correctly.
Check whether the hello-world image has been successfully downloaded. You can see that the hello-world image has been pulled into docker:
root@192 opt]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest feb5d9fea6a5 40 hours ago 13.3kB
nginx latest f35646e83998 11 months ago 133MB
ubuntu latest 549b9b86cb8d 21 months ago 64.2MB
————————————————