docker 安装ubantu
时间: 2023-11-23 17:58:12 浏览: 82
以下是在Ubuntu上安装Docker的步骤:
1.卸载旧版本的Docker
```shell
sudo apt-get remove docker docker-engine docker.io containerd runc
```
2.更新apt软件包索引并安装依赖包
```shell
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
```
3.添加Docker官方的GPG密钥
```shell
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
```
4.设置Docker稳定版存储库
```shell
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
```
5.更新apt软件包索引并安装Docker CE
```shell
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
```
6.验证Docker是否正确安装并运行
```shell
sudo docker run hello-world
```
阅读全文