ubuntu20.04安装Docker
时间: 2023-08-18 21:07:37 浏览: 151
在Ubuntu 20.04上安装Docker的步骤如下:
1. 首先,您需要将Docker的官方GPG密钥添加到系统中。您可以使用以下命令来添加密钥:
```
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
```
2. 接下来,您需要添加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
```
3. 更新APT软件包索引:
```
$ sudo apt-get update
```
4. 最后,安装Docker:
```
$ sudo apt-get install docker-ce docker-ce-cli containerd.io
```
安装完成后,您可以使用以下命令来验证Docker是否正确安装:
```
$ sudo docker run hello-world
```
这将运行一个简单的容器,并显示一条消息,表示Docker已成功安装和运行。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [ubuntu20.04下安装docker](https://blog.csdn.net/BigData_Mining/article/details/108296719)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
阅读全文