linux安装docker1.19.5
时间: 2023-09-16 10:14:11 浏览: 97
要在Linux上安装指定版本的Docker,你可以按照以下步骤进行操作:
1. 首先,确保已经卸载了之前的Docker版本(如果已安装)。可以使用以下命令卸载Docker:
```
sudo apt-get remove docker docker-engine docker.io containerd runc
```
2. 接下来,需要安装Docker的依赖包。运行以下命令更新软件包列表并安装依赖项:
```
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
```
3. 接着,添加Docker的官方GPG密钥。运行以下命令:
```
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
```
4. 添加Docker存储库。根据您的Linux发行版选择适当的命令:
- 对于Ubuntu 20.04:
```
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu focal stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
```
- 对于Ubuntu 18.04:
```
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu bionic stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
```
- 对于其他Linux发行版,请参考官方文档:https://docs.docker.com/engine/install/
5. 运行以下命令安装Docker:
```
sudo apt-get update
阅读全文