Deepin系统安装docker

因为deepin是基于debian发行版的一个操作系统,所以我们deepin用户安装docker可以直接按照下面这个官方教程来安装,不过由于deepin的特殊性,在第三步会遇到点问题,这里主要记录一下问题得解决办法,先看一下会出问题的这步:

3 Use the following command to set up the stable repository. To add the nightly or test repository, add the word nightly or test (or both) after the word stable in the commands below. Learn about nightly and test channels.
Note: The lsb_release -cs sub-command below returns the name of your Debian distribution, such as helium. Sometimes, in a distribution like BunsenLabs Linux, you might need to change $(lsb_release -cs) to your parent Debian distribution. For example, if you are using BunsenLabs Linux Helium, you could use stretch. Docker does not offer any guarantees on untested and unsupported Debian distributions.
$ sudo add-apt-repository
“deb [arch=amd64] https://download.docker.com/linux/debian
$(lsb_release -cs)
stable”

sudo add-apt-repository “deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable”

这条命令主要就是在我们的软件源列表里加一行docker的源,执行这条命令的时候会报错,我们通过lsb_release -cs命令可以看到我们的系统发行版信息,得到结果是 stable ,因为目前docker官方并没有针对stable的版本,所以我选择手动添加一下源,直接编辑 /etc/apt/sources.list

sudo vim /etc/apt/sources.list  
#文件最后添加一行 
deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/debian stretch stable 
# :qw 保存退出

然后就是继续按照官方文档操作就行

 sudo apt-get update # 更新源
 sudo apt-get install docker-ce docker-ce-cli containerd.io # 安装
 sudo docker run hello-world  # 测试一下有没有问题

安装完成

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐