docker desktop安装教程ubuntu
时间: 2024-12-25 21:16:21 浏览: 4
Docker Desktop 在 Ubuntu 系统上安装可以分为几个步骤:
1. 更新包列表:
```bash
sudo apt-get update
```
2. 安装依赖库:
```
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common lsb-release
```
3. 添加 Docker GPG 公钥:
```bash
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
```
4. 添加 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
```
5. 验证并更新软件源:
```bash
sudo apt-get update
```
6. 安装 Docker Desktop:
```
sudo apt-get install docker-ce docker-ce-cli containerd.io
```
7. 启动 Docker 和设置自动启动:
```bash
sudo systemctl start docker
sudo systemctl enable docker
```
8. 首次运行时,会提示设置 Docker 用户账户,按照提示操作即可。
阅读全文