Docker安装

前言

每次装新版本的Ubuntu时总要上网搜索一下docker安装命令,因此记录一下,免得以后找的时候不方便。

本文命令都是从如何在 Ubuntu 20.04 上安装和使用 Docker抄下来的。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
sudo apt update

#安装必要的依赖软件,来添加一个新的 HTTPS 软件源
sudo apt install apt-transport-https ca-certificates
curl gnupg-agent software-properties-common

#导入源仓库的 GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

#将 Docker APT 软件源添加到系统
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

#安装
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io

参考文章

https://zhuanlan.zhihu.com/p/143156163


Docker安装
https://h0pe-ay.github.io/Docker安装/
作者
hope
发布于
2023年6月27日
许可协议