前言
一代版本一代神
安装请参考官方文档
https://docs.docker.com/engine/install/centos/
卸载旧版本
sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
添加依赖
sudo yum install -y yum-utils
添加repo
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
安装
sudo yum install docker-ce docker-ce-cli containerd.io docker-compose-plugin
卸载
sudo yum remove docker-ce docker-ce-cli containerd.io docker-compose-plugin
查看docker版本
# Docker version 20.10.14, build a224086
docker -v
启动docker
sudo systemctl start docker
停止docker
sudo systemctl stop docker.socket \
docker.service \
docker