如何在CentOS中安装Docker
本帖最后由 freeloop 于 2025-3-27 16:24 编辑为大家分享如何在CentOS中安装Docker
1.若您系统中已安装了docker,需先删除
yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
3.添加docker官方仓库
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
4.安装完成后启动docker服务
sudo systemctl start docker
5.检查docker是否正常运行
sudo systemctl status docker若正常运行则会显示active(running)
6.设置docker自动启动
sudo systemctl enable docker
7.卸载docker
sudo yum remove docker-ce docker-ce-cli containerd.io -ysudo rm -rf /var/lib/docker
页:
[1]