在centos7中安装docker
时间: 2023-09-02 07:09:00 浏览: 68
centos7 的 docker 离线安装包,rpm安装可用,百度云下载
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
```
阅读全文