ubuntu 安装docker docker-compose

完全借鉴此篇博客即可。

https://www.cnblogs.com/tianhei/p/7802064.html

 

 最近发现上个url安装太慢,推荐看这个

https://blog.csdn.net/EricLeiy/article/details/78849650

 

刚装好后遇到的问题报这个错误时候

ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.

正确的是将当前用户加入docker组
jing@ubuntu:/tmp/docker$ sudo gpasswd -a ${USER} docker

然后退出当前用户比如切换为root,再次切换为jing。然后执行docker-compose up -d就ok了。

jing@ubuntu:/tmp/docker$ sudo su
root@ubuntu:/tmp/docker$ su jing
jing@ubuntu:/tmp/docker$ docker-compose up -d

你可能感兴趣的:(安装docker)