1.Dockerfile
# 查看源信息【不同镜像】
cat /etc/apt/sources.list.d/debian.sources
Types: deb
# http://snapshot.debian.org/archive/debian/20230919T000000Z
URIs: http://deb.debian.org/debian
Suites: bookworm bookworm-updates
Components: main
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
Types: deb
# http://snapshot.debian.org/archive/debian-security/20230919T000000Z
URIs: http://deb.debian.org/debian-security
Suites: bookworm-security
Components: main
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
# 将apt-get源更换为阿里云的镜像
RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list.d/debian.sources
# 将apt-get源更换为清华的镜像
RUN sed -i 's|http://deb.debian.org/|https://mirrors.tuna.tsinghua.edu.cn/|g' /etc/apt/sources.list.d/debian.sources