1设置源
# deb cdrom:[Debian GNU/Linux 12.4.0 _Bookworm_ - Official amd64 DVD Binary-1 with firmware 20231210-17:57]/ bookworm main non-free-firmware
deb http://ftp.cn.debian.org/debian/ bookworm main non-free-firmware
deb-src http://ftp.cn.debian.org/debian/ bookworm main non-free-firmware
deb http://ftp.cn.debian.org/debian/ bookworm-security main non-free-firmware
deb-src http://ftp.cn.debian.org/debian/ bookworm-security main non-free-firmware
# bookworm-updates, to get updates before a point release is made;
# see https://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_updates_and_backports
deb http://ftp.cn.debian.org/debian/ bookworm-updates main non-free-firmware
deb-src http://ftp.cn.debian.org/debian/ bookworm-updates main non-free-firmware
2.安装依赖包
#apt install apt-transport-https ca-certificates curl gnupg lsb-release
3.添加Docker源
(1)添加Docker 官方GPG密钥
#curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
(2)添加Docker源
#echo “deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian
$(lsb_release -cs) stable” | tee /etc/apt/sources.list.d/docker.list > /dev/null
(3)更新软件包缓存
#apt update
4.安装Docker
#apt install docker-ce docker-ce-cli containerd.io
如果Docker未运行,请执行如下命令启动它。
#systemctl start docker
(2)设置Docker开机自动启动
#systemctl enable docker
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo apt-get remove docker docker-engine docker.io containerd runc
推荐阅读:

发表评论