一键安装

#阿里云
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun 
daocloud 一键安装命令:
curl -sSL https://get.daocloud.io/docker | sh


#docker-compose安装国内加速
sudo curl -L "https://get.daocloud.io/docker/compose/releases/download/v2.12.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
#设置权限
sudo chmod +x /usr/local/bin/docker-compose


systemctl start docker
systemctl enable docker

#测试
docker run hello-world

手工安装

yum install -y yum-utils
yum-config-manager --add-repo https://download.docker.com/linux/centos/decker-ce.repo

yum install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin

卸载

systemctl  stop docker
rm -rf /var/lib/docker
rm -rf /var/lib/containerd

yum remove docker-ce docker-ce-cli containerd.io docker-compose-plugin