【Deepin】安装docker

rss@rss-PC:~/Desktop$ sudo add-apt-repository “deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable”
请输入密码
[sudo] rss 的密码:
验证成功
Error: need a single repository as argument
rss@rss-PC:~/Desktop$ sudo add-apt-repository “deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable”
Error: need a single repository as argument
rss@rss-PC:~/Desktop

修改sources.list 文件

打开/etc/apt/sources.list 文件,将下面的内容添加文件最后,【Esc】键入 :wq! 保存退出

deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/debian stretch stable 


rss@rss-PC:~/Desktop$ sudo vim /etc/apt/sources.list 

## Generated by deepin-installer
deb [by-hash=force] https://community-packages.deepin.com/deepin/ apricot main contrib non-free
#deb-src https://community-packages.deepin.com/deepin/ apricot main contrib non-free

## Generated by deepin-installer
deb [by-hash=force] https://community-packages.deepin.com/deepin/ apricot main contrib non-free
#deb-src https://community-packages.deepin.com/deepin/ apricot main contrib non-free
deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/debian stretch stable 

Esc

:wq!

更新源


rss@rss-PC:~/Desktop$ sudo apt-get update
命中:1 https://mirrors.aliyun.com/docker-ce/linux/debian buster InRelease
获取:2 https://mirrors.ustc.edu.cn/docker-ce/linux/debian stretch InRelease [44.8 kB]                        
获取:3 https://mirrors.ustc.edu.cn/docker-ce/linux/debian stretch/stable amd64 Packages [15.5 kB]            
命中:4 https://community-packages.deepin.com/deepin apricot InRelease                                        
命中:5 https://community-packages.deepin.com/printer eagle InRelease                                         
获取:6 https://community-store-packages.deepin.com/appstore eagle InRelease [5,289 B]                        
获取:7 https://community-store-packages.deepin.com/appstore eagle/appstore amd64 Packages [634 kB]           
已下载 699 kB,耗时 11秒 (65.4 kB/s)                                                                         
正在读取软件包列表... 完成

安装docker

rss@rss-PC:~/Desktop$ sudo apt-get install docker-ce docker-ce-cli containerd.io
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
docker-ce-cli 已经是最新版 (5:20.10.1~3-0~debian-buster)。
docker-ce-cli 已设置为手动安装。
docker-ce 已经是最新版 (5:20.10.1~3-0~debian-buster)。
下列软件包将被升级:
  containerd.io
升级了 1 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 160 个软件包未被升级。
需要下载 28.1 MB 的归档。
解压缩后将会空出 15.4 kB 的空间。
您希望继续执行吗? [Y/n] Y
获取:1 https://mirrors.ustc.edu.cn/docker-ce/linux/debian stretch/stable amd64 containerd.io amd64 1.4.3-1 [28.1 MB]
已下载 28.1 MB,耗时 1分 9秒 (408 kB/s)                                                                      
E: 无法下载 https://mirrors.ustc.edu.cn/docker-ce/linux/debian/dists/stretch/pool/stable/amd64/containerd.io_1.4.3-1_amd64.deb  无法重命名文件,没有那个文件或目录 (/var/cache/apt/archives/partial/containerd.io_1.4.3-1_amd64.deb -> /var/cache/apt/archives/containerd.io_1.4.3-1_amd64.deb)。
E: 有几个软件包无法下载,要不运行 apt-get update 或者加上 --fix-missing 的选项再试试?

修复源

rss@rss-PC:~/Desktop$ sudo apt-get update --fix-missing
命中:1 https://mirrors.aliyun.com/docker-ce/linux/debian buster InRelease
命中:2 https://mirrors.ustc.edu.cn/docker-ce/linux/debian stretch InRelease                                  
命中:3 https://community-store-packages.deepin.com/appstore eagle InRelease                                  
命中:4 https://community-packages.deepin.com/deepin apricot InRelease                                        
命中:5 https://community-packages.deepin.com/printer eagle InRelease
正在读取软件包列表... 完成

重新安装

rss@rss-PC:~/Desktop$ sudo apt-get install docker-ce docker-ce-cli containerd.io
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
docker-ce-cli 已经是最新版 (5:20.10.1~3-0~debian-buster)。
docker-ce-cli 已设置为手动安装。
docker-ce 已经是最新版 (5:20.10.1~3-0~debian-buster)。
下列软件包将被升级:
  containerd.io
升级了 1 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 160 个软件包未被升级。
需要下载 0 B/28.1 MB 的归档。
解压缩后将会空出 15.4 kB 的空间。
您希望继续执行吗? [Y/n] Y
(正在读取数据库 ... 系统当前共安装有 214636 个文件和目录。)
准备解压 .../containerd.io_1.4.3-1_amd64.deb  ...
正在解压 containerd.io (1.4.3-1) 并覆盖 (1.4.3-1) ...
正在设置 containerd.io (1.4.3-1) ...
正在处理用于 man-db (2.8.5-2) 的触发器 ...

测试Docker是否安装完成

rss@rss-PC:~/Desktop$ sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
0e03bdcc26d7: Pull complete 
Digest: sha256:1a523af650137b8accdaed439c17d684df61ee4d74feac151b5b337bd29e7eec
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

rss@rss-PC:~/Desktop$

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值