怎么在linux openeular下安装docker
时间: 2024-11-27 17:09:23 浏览: 9
在Linux OpenEuler系统上安装Docker,你可以按照以下步骤操作:
1. **更新包列表**:
```bash
sudo apt-get update
```
2. **添加Docker GPG密钥**:
```bash
curl -fsSL https://download.docker.com/linux/openeuler/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
```
3. **配置Apt源**:
```bash
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/openeuler stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
```
4. **刷新并安装**:
```bash
sudo apt-get install apt-transport-https ca-certificates
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
```
5. **启动和启用Docker服务**:
```bash
sudo systemctl start docker
sudo systemctl enable docker
```
6. **检查安装**:
```bash
sudo docker run hello-world
```
如果安装成功,你应该能看到Docker的欢迎信息。
阅读全文