centos8.3安装docker
时间: 2023-11-17 20:03:53 浏览: 82
以下是在CentOS 8.3上安装Docker的步骤:
1. 确认系统内核版本是否大于3.10:
CentOS 7.4 可能为3.10.0-957.12.1.el7.x86_64 只要大于3.10 都可以安装。
2. 检查是否已经安装过Docker:
```
yum list installed | grep docker
```
3. 安装必要的依赖包:
```
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
```
4. 添加Docker软件源:
```
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
```
5. 安装Docker:
```
sudo yum install docker-ce docker-ce-cli containerd.io
```
6. 启动Docker并设置开机自启:
```
sudo systemctl start docker
sudo systemctl enable docker
```
7. 验证Docker是否安装成功:
```
sudo docker run hello-world
```
如果输出以下内容,则说明Docker安装成功:
```
Hello from Docker!
This message shows that your installation appears to be working correctly.
```
阅读全文