Docker安装

作者: x00c | 来源:发表于2019-07-07 20:40 被阅读2次

环境: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

相关文章

网友评论

    本文标题:Docker安装

    本文链接:https://www.haomeiwen.com/subject/rkdbhctx.html