debian12实践-安装docker
参考:https://linuxiac.com/how-to-install-docker-on-debian-12-bookworm/
step1
sudo apt update
sudo apt install apt-transport-https ca-certificates curl gnupg
step2:这一步多尝试两次,避免网络原因下载失败
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker.gpg
step3
echo “deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker.gpg] https://download.docker.com/linux/debian bookworm stable” | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
step4
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
step5
sudo systemctl is-active docker
#显示active,表示安装成功!
#加入自启动(可选)
#systemctl enable docker.service
step6:测试
sudo docker run hello-world
更换docker镜像源
nano /etc/docker/daemon.json
{
"registry-mirrors" : [
"https://dockerproxy.com",
"https://hub-mirror.c.163.com",
"https://mirror.baidubce.com",
"https://ccr.ccs.tencentyun.com"
]
}