安装

官网安装
curl -fsSL https://get.docker.com | sh

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

#清华安装
export DOWNLOAD_URL="https://mirrors.tuna.tsinghua.edu.cn/docker-ce"
sudo curl -fsSL https://get.docker.com/ | sudo -E sh

#中科大安装
curl -fsSL https://get.docker.com -o get-docker.sh
sudo DOWNLOAD_URL=https://mirrors.ustc.edu.cn/docker-ce sh get-docker.sh

debian

#使用存储库安装,(不是最新版)
apt-get update
sudo apt install docker.io -y

阿里云 centos

https://help.aliyun.com/zh/ecs/use-cases/deploy-and-use-docker-on-alibaba-cloud-linux-2-instances
Alibaba Cloud Linux 3.2104 LTS
Red Hat
Anoli OS
RockyLinux
AlmaLinux

#新版
# sudo yum -y install dnf
sudo dnf install -y device-mapper-persistent-data lvm2
sudo dnf config-manager --add-repo=https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
sudo dnf -y install dnf-plugin-releasever-adapter --repo alinux3-plus
sudo dnf list docker-ce
sudo dnf install -y docker-ce --nobest


#阿里云系统
sudo dnf config-manager --add-repo=https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
sudo dnf -y install dnf-plugin-releasever-adapter --repo alinux3-plus
sudo dnf -y install docker-ce --nobest


systemctl start docker 
systemctl enable docker
  • Anolis OS
#ANCK支持阿里云的 dnf安装,参考上面
#sudo yum install -y docker(安装的是podman)
#sudo dnf update -y
yum autoremove podman -y
dnf install -y docker-ce --nobest 安装报错时按提示添加参数:  dnf install -y docker-ce --allowerasing


#官方
sudo dnf install -y yum-utils device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo dnf install -y docker-ce docker-ce-cli containerd.io
或者
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum -y install docker-ce docker-ce-cli containerd.io

腾讯云 (ubuntu)

https://cloud.tencent.com/document/product/1207/45596

#ubuntu(复制官方命令)
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
echo   "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://mirrors.cloud.tencent.com/docker-ce/linux/ubuntu/ \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" |   sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

华为云

https://bbs.huaweicloud.com/blogs/379490



RockyLinux安装

dnf install docker-ce --nobest