Docker安装

环境:ubuntu19.04

1.安装docker

安装依赖包

sudo apt install apt-transport-https ca-certificates curl software-properties-common

确保软件的安全性,添加GPE密钥

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

将docker源添加到source.list

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic test"

更新apt

sudo apt update

安装docker-ce

sudo apt install docker-ce

备注:使用ubuntu17以及其他版本的教程都遇到问题,上述可以进行ubuntu19的正常安装。

2.启动docker

sudo systemctl start docker

sudo docker run hello-world

hello-world运行成功

3.添加到用户组

sudo groupadd docker

sudo gpasswd -a yuan docker

-- 其中yuan替换为用户

退出当前用户重新登陆下即可


参考:

安装教程

https://yeasy.gitbooks.io/docker_practice/install/ubuntu.html

https://docs.docker.com/v17.09/engine/installation/linux/docker-ce/ubuntu/#install-using-the-repository

问题解决

https://askubuntu.com/questions/1030179/package-docker-ce-has-no-installation-candidate-in-18-04

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。