1. 更新系统
首先,确保你的系统是最新的。
sudo apt update && sudo apt upgrade -y
2. 安装 Docker 和 Docker Compose
安装 Docker 的必要依赖包
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
3.添加 Docker 的 GPG 密钥
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
4.设置 Docker 的 stable 仓库
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
5.更新包列表并安装 Docker :
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io
6.安装 Docker Compose
sudo curl -L "https://github.com/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
如若转载请注明出处:
真棒!