centos7 docker离线安装
时间: 2023-11-21 08:58:58 浏览: 58
以下是CentOS 7离线安装Docker的步骤:
1.卸载旧版本的Docker(如果有):
```shell
sudo yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine
```
2.安装依赖包:
```shell
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
```
3.添加Docker的yum源:
```shell
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
```
4.查看Docker的所有版本:
```shell
yum list docker-ce --showduplicates | sort -r
```
5.安装指定版本的Docker:
```shell
sudo yum install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING> containerd.io
```
6.启动Docker并设置开机自启:
```shell
sudo systemctl start docker
sudo systemctl enable docker
```
7.验证Docker是否安装成功:
```shell
docker -v
```