linux Ubuntu 安装dockers
时间: 2023-11-10 07:02:08 浏览: 109
安装 Docker 在 Ubuntu 上有以下几个步骤:
1. 安装必要的软件包:
```
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release
```
2. 添加 Docker 的官方 GPG 密钥:
```
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
```
3. 添加 Docker APT 仓库:
```
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
```
4. 安装 Docker Engine:
```
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
```
5. 验证 Docker 是否正确安装:
```
sudo docker run hello-world
```
阅读全文