ubuntu怎么安装dockers
时间: 2024-08-20 07:02:17 浏览: 57
在Ubuntu系统上安装Docker,你可以按照以下步骤操作:
1. **更新包列表**:
```
sudo apt-get update
```
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. **安装信任存储库**:
```
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
```
5. **确认并安装Docker**:
```
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
```
6. **启动并启用Docker服务**:
```
sudo systemctl start docker
sudo systemctl enable docker
```
7. **检查Docker是否安装成功**:
```
sudo docker run hello-world
```
阅读全文