系统:ubuntu16.04 我是按照docker的文档上安装的 https://docs.docker.com/linux/step_one/ 安装完成后docker的ps pull search run命令都会报这个错 Cannot connect to the Docker daemon. Is the docker daemon running on this host?
You need to add user into docker group. by 'sudo gpasswd -a xxxx docker' (xxx is your user name) Then restart your computer. This problem should be solved.
我也出现过类似的错误。
因为,我忘记启动docker这个服务了。
service docker start
请使用
sudo
You need to add user into docker group. by 'sudo gpasswd -a xxxx docker' (xxx is your user name)
Then restart your computer.
This problem should be solved.
docker-machine restart&&eval "$(docker-machine env default)"&&docker-machine env 运行这么一串就好了
看下docker启动的默认配置
/etc/default/docker
没问题呗,然后重启服务service docker restart
。sudo docker -H unix:///var/run/docker.sock -d &
使用 -H 可以改变docker进程监听指定的IP和端口。默认情况下,docker会监听 unix:///var/run/docker.sock,只允许本地的root用户连接。可以参考《Docker教程-学习基本命令》
重装docker。
su root # 先切换到root用户, 再执行以下命令
systemctl enable docker # 开机自动启动docker
systemctl start docker # 启动docker
systemctl restart docker # 重启dokcer