场景

执行docker build命令的时候报错,信息为:
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

解决方案

执行如下命令即可

systemctl daemon-reload;
systemctl restart docker;
systemctl status docker; # 查看状态