Ubuntu22.04安装docker
时间: 2024-01-19 16:18:26 浏览: 124
ubuntu安装docker
以下是在Ubuntu 22.04上安装Docker的步骤:
1. 安装Docker依赖项:
```shell
sudo apt update
sudo apt install -y ca-certificates curl gnupg lsb-release
```
2. 启用Docker官方存储库:
```shell
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
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. 安装Docker Engine:
```shell
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io
```
4. 验证Docker是否成功安装:
```shell
sudo docker run hello-world
```
以上是在Ubuntu 22.04上安装Docker的步骤。
阅读全文