Debian11的apt源
清华源
cat > /etc/apt/sources.list << EOF
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security/ bullseye-security main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security/ bullseye-security main contrib non-free
EOF
Debian11安装docker
更新并安装一些必要系统工具
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install \
apt-transport-https \
software-properties-common \
ca-certificates \
curl \
gnupg \
lsb-release
安装GPG证书
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/debian/gpg | apt-key add -
写入软件源信息
add-apt-repository "deb [arch=amd64] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/debian $(lsb_release -cs) stable"
更新并安装社区版Docker-ce以及docker-compose插件
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
设置开机自启动
sudo systemctl enable docker
启动
sudo systemctl start docker
测试,输入以下代码,能出现版本信息则说明安装成功
docker version
创建或修改配置文件,否则docker的默认镜像源无法下载镜像
vim /etc/docker/daemon.json
添加如下内容
{
"registry-mirrors": ["https://docker.chenby.cn"]
}
重新加载docker配置并重启
sudo systemctl daemon-reload
sudo systemctl restart docke