centOS安装docker
时间: 2023-11-11 21:06:21 浏览: 121
Centos安装Docker
CentOS安装Docker的步骤如下:
1. 卸载旧版本的Docker(如果有):sudo yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine
2. 安装必要的依赖包:sudo yum install -y yum-utils device-mapper-persistent-data lvm2
3. 添加Docker的yum源:sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
4. 安装Docker:sudo yum install docker-ce docker-ce-cli containerd.io
5. 启动Docker并设置开机自启:sudo systemctl start docker && sudo systemctl enable docker
6. 验证Docker是否安装成功:sudo docker run hello-world
阅读全文