ubuntu安装DOCKER
时间: 2024-06-26 16:01:10 浏览: 226
ubuntu安装docker
在Ubuntu系统上安装Docker,你可以按照以下步骤操作:
1. 更新系统软件包:
```bash
sudo apt-get update
sudo apt-get upgrade
```
2. 安装 Universe 和 Multiverse 软件源,因为Docker通常在这些存储库中提供:
```bash
sudo add-apt-repository universe
sudo add-apt-repository multiverse
```
3. 搜索并安装Docker GPG密钥,确认安装来源的可信性:
```bash
wget -qO- https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
```
4. 添加Docker APT仓库到系统:
```bash
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. 更新软件包列表,并安装Docker:
```bash
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
```
6. 启动Docker服务并设置开机自启动:
```bash
sudo systemctl start docker
sudo systemctl enable docker
```
7. 验证安装是否成功,运行Docker命令行客户端:
```bash
docker --version
```
阅读全文