Linux中的docker报错 Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

Being given a chance to start docker in centos installed in:

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

 

Solution is as follows:

  1. Create the docker group.
    sudo groupadd docker
  2. Add the user to the docker group.
    sudo usermod -aG docker $(whoami)
  3. Log out and log back in to ensure docker runs with correct permissions.
  4. Start docker.
    sudo service docker start

Guess you like

Origin www.cnblogs.com/lieweidu/p/12050053.html