Ubuntu20安装Docker详细步骤
秋一叶 2020-12-18 13:36:08 3347 收藏 12
分类专栏: Docker 文章标签: docker ubuntu
版权
前言
ubuntu版本:20.10
阿里巴巴开源镜像网站:https://developer.aliyun.com/mirror/
Ubuntu安装Docker步骤
1、卸载旧版本
$ sudo apt-get remove docker docker-engine docker.io containerd runc
1
2、更新apt软件包索引并安装软件包以允许apt通过HTTPS使用存储库
$ sudo apt-get update
$ sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
1
2
3
4
5
6
7
3、添加Docker的官方GPG密钥
$ - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
//通过搜索指纹的后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]
1
2
3
4
5
6
7
8
4、添加仓库
$ sudo add-apt-repository \
“deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable”
1
2
3
4
5、安装docer引擎
//更新apt程序包索引,并安装最新版本的Docker Engine和容器
$ sudo apt-get update
$ sudo apt-get install docker-ce docker-ce-cli containerd.io
1
2
3
6、通过运行hello-world 映像来验证是否正确安装了Docker Engine
$ sudo docker run hello-world
————————————————
版权声明:本文为CSDN博主「秋一叶」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_36335426/article/details/111308213