准备安装环境
apt install curl vim wget gnupg dpkg apt-transport-https lsb-release ca-certificates
添加 GPG公钥 和 apt源
curl -sS https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/debian/gpg | gpg --dearmor > /usr/share/keyrings/docker-ce.gpg
echo "deb [arch=(dpkg−−print−architecture)signed−by=/usr/share/keyrings/docker−ce.gpg]https://mirrors.tuna.tsinghua.edu.cn/docker−ce/linux/debian(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-ce.gpg] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/debian (lsb_release -sc) stable" > /etc/apt/sources.list.d/docker.list
安装 Docker CE 和 Docker Compose 插件
apt update
apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin
检测是否安装成功
检查 docker 是否安装成功
docker version
检查 compose 是否安装成功
docker compose version
编辑 docker 配置