llinuxMX 安装docker
时间: 2024-12-20 22:06:12 浏览: 3
在Linux MX(基于Debian的Linux发行版)上安装Docker,你需要按照以下步骤进行:
1. **更新包列表**:
```
sudo apt-get update
```
2. **安装依赖项**:
```
sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release
```
3. **添加Docker GPG key**:
```
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
```
4. **将Docker仓库添加到apt sources**:
```
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客户端和容器引擎**:
```
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. **检查安装**:
```
sudo docker run hello-world
```
如果一切顺利,你应该能看到Docker的欢迎信息,表示安装成功。
阅读全文