零:卸载旧版本
Docker 的旧版本被称为 docker,docker.io 或 docker-engine 。如果已安装,请卸载它们:
$ sudo apt-get remove docker docker-engine docker.io containerd runc
当前称为 Docker Engine-Community 软件包 docker-ce 。
一:设置仓库
在新主机上首次安装 Docker Engine-Community 之前,需要设置 Docker 仓库。之后,您可以从仓库安装和更新 Docker 。
更新 apt 包索引。
$ sudo apt-get update
安装 apt 依赖包,用于通过HTTPS来获取仓库:
$ sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
添加 Docker 的官方 GPG 密钥:
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88 通过搜索指纹的后8个字符,验证您现在是否拥有带有指纹的密钥。
$ sudo apt-key fingerprint 0EBFCD88 pub rsa4096 2017-02-22 [SCEA] 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88 uid [ unknown] Docker Release (CE deb) <docker@docker.com> sub rsa4096 2017-02-22 [S]
使用以下指令设置稳定版仓库
注意:目前 20.04 还没有国内 docker 源,暂时用 18.04 版本。
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
二:安装 Docker Engine-Community
更新 apt 包索引。
$ sudo apt-get update
安装最新版本的 Docker Engine-Community 和 containerd
$ sudo apt-get install docker-ce docker-ce-cli containerd.io
三:测试
输入
$ sudo docker run hello-world
如果docker和你问好——或者说出现类似以下输出
Unable to find image 'hello-world:latest' locally latest: Pulling from library/hello-world 1b930d010525: Pull complete Digest: sha256:c3b4ada4687bbaa170745b3e4dd8ac3f194ca95b2d0518b417fb47e5879d9b5f 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/
就说明安装完事了。
四:免sudo运行&镜像加速
免sudo
参考如下方法将用户添加到docke组
$ sudo usermod -aG docker [你的用户名]
重启docker
$ sudo systemctl restart docker
(然而我的机器上发生了很诡异的事——我重启docker服务后依然不能以普通用户启动docker。重启机器后才能免sudo运行。)
docker镜像加速
我用了阿里云的免费加速
https://cr.console.aliyun.com/cn-hangzhou/instances/mirrors
后续设置按照阿里云网页内提示即可,不再赘述。
五:参考链接
-Windows10 安装 WSL2 Ubuntu20.04 并设置 docker 环境
-Ubuntu Docker 安装
P70系列延期,华为新旗舰将在下月发布
3月20日消息,近期博主@数码闲聊站 透露,原定三月份发布的华为新旗舰P70系列延期发布,预计4月份上市。
而博主@定焦数码 爆料,华为的P70系列在定位上已经超过了Mate60,成为了重要的旗舰系列之一。它肩负着重返影像领域顶尖的使命。那么这次P70会带来哪些令人惊艳的创新呢?
根据目前爆料的消息来看,华为P70系列将推出三个版本,其中P70和P70 Pro采用了三角形的摄像头模组设计,而P70 Art则采用了与上一代P60 Art相似的不规则形状设计。这样的外观是否好看见仁见智,但辨识度绝对拉满。
更新日志
- 谭小环.1997-自主【BMG】【WAV+CUE】
- 张震岳《精选 滚石SACD系列》首批限量编号 [SACD ISO][1.1G]
- 童丽《独家爱唱7》头版限量编号24K金碟[DFF][1.6G]
- 韩宝仪《我心若玫瑰》[WAV+CUE][441M]
- 群星《经典老歌百万畅销LP黑胶》10CD[WAV+CUE][6.3G]
- 蔡琴《伤心小站SACD》[DSF][1.1G]
- 群星《青春重置计划 4 珍稀》[320K/MP3][207.12MB]
- 黑帝斯哈迪斯2女巫之杖法杖图鉴及附魔效果一览 法杖图文攻略
- 鸣潮炽霞声骸怎么选择 炽霞声骸搭配及词条选择攻略
- 黑帝斯哈迪斯2姊妹双刃图鉴及附魔效果一览 黑帝斯哈迪斯2全武器图文介绍
- 刘文正.2013-金典歌展2CD【南方】【WAV+CUE】
- 刘珺儿.2001-标准心上人【P.TMUSIC】【WAV+CUE】
- WBG入选沙特电竞世界杯!角逐多个电竞项目
- 《小谢尔顿》最终季大结局首曝片段 成年谢米回归!
- 鸣潮凌阳声骸怎么选择 凌阳声骸搭配及词条选择攻略