在centos7中安装docker
时间: 2023-09-02 16:09:00 浏览: 66
在CentOS 7中安装 Docker
1. 更新系统:
```
sudo yum update
```
2. 安装依赖包:
```
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
```
3. 添加Docker仓库:
```
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
```
4. 安装Docker CE:
```
sudo yum install docker-ce
```
5. 启动Docker服务:
```
sudo systemctl start docker
```
6. 设置Docker开机自启:
```
sudo systemctl enable docker
```
7. 测试Docker是否安装成功:
```
sudo docker run hello-world
```
阅读全文