centos7 安装docker19.03
时间: 2023-11-21 22:57:28 浏览: 131
centos7.6机器上离线安装docker-ce-19.03、nvidia-docker2
以下是在CentOS 7上安装Docker CE 19.03的步骤:
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 CE存储库:
```shell
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
```
4.安装Docker CE:
```shell
sudo yum install docker-ce-19.03.0 docker-ce-cli-19.03.0 containerd.io
```
5.启动Docker并将其设置为开机启动:
```shell
sudo systemctl start docker
sudo systemctl enable docker
```
6.验证Docker是否正确安装:
```shell
sudo docker run hello-world
```
如果一切正常,你将看到一个欢迎信息。
阅读全文