Unable to start docker service after installing docker under ubuntu

as mentioned above, when docker, is installed under ubuntu, there is a lack of permissions at the beginning of startup, and then switch to root to start. It is found that there is no error after startup, but the docker service is still not started.

I don"t know why. I hope someone can give me some advice.

Nov.23,2021

you need to check the log output of docker daemon

different Syslog outputs are in different locations. Take a look at

Ubuntu (old using upstart ) - /var/log/upstart/docker.log
Ubuntu (new using systemd ) - sudo journalctl -fu docker.service
Amazon Linux AMI - /var/log/docker
Boot2Docker - /var/log/docker.log
Debian GNU/Linux - /var/log/daemon.log
CentOS - /var/log/daemon.log | grep docker
CoreOS - journalctl -u docker.service
Fedora - journalctl -u docker.service
Red Hat Enterprise Linux Server - /var/log/messages | grep docker
OpenSuSE - journalctl -u docker.service
OSX - ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/log/docker.log
Windows - Get-EventLog -LogName Application -Source Docker -After (Get-Date).AddMinutes(-5) | Sort-Object Time, as mentioned here.

I remember that the docker installed by ubuntu can be controlled by systemd.

check whether / lib/systemd/system has the file docker.service (the directory may be different, you can search it with locate docker.service first)
start

with the following command

:

systemctl daemon-reload
sudo service docker restart
sudo service docker status (should see active (running)
sudo docker run hello-world

execute these commands to see if docker is working properly.
if it doesn't work, take a look at docker's log to see the error message in the log. The log is a good thing!
Log file: / var/log/upstart/docker.log

Menu