Ubuntu安装docker教程

官方教程

这里给出我的安装配置过程,使用阿里源安装。
1.卸载旧版本

sudo apt-get remove docker docker-engine docker.io containerd runc

如果存在旧版本,我们需要使用该命令卸载它,不存在也没有关系,只是会报告没有安装这些软件包。
2.安装一些必要的系统工具

sudo apt-get update #获取软件最新源
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common

3.安装GPG证书

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

在这里插入图片描述
4.写入软件源信息

sudo add-apt-repository "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"

在这里插入图片描述
5.更新并安装docker引擎

sudo apt-get -y update
sudo apt-get -y install docker-ce docker-ce-cli containerd.io

如果需要安装特定的docker版本,可以参照官网。

6.测试是否安装成功

sudo docker run hello-world

在这里插入图片描述
如上则说明安装成功。

posted @ 2022-03-26 16:47  unique_pursuit  阅读(3191)  评论(0)    收藏  举报