docker-on-debian11
要在 Debian 上安装 Docker,请按照以下步骤:
- 更新apt-get:
apt update
- 安装依赖软件包:
apt install -y apt-transport-https ca-certificates curl gnupg lsb-release
- 添加Docker GPG密钥:
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
- 添加Docker存储库:
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
- 更新apt-get:
apt update
- 安装Docker:
apt install -y docker-ce docker-ce-cli containerd.io
- 验证安装是否成功:
docker run hello-world
如果成功安装, 将会输出“Hello from Docker!”