diff --git a/Dockerfile b/Dockerfile index 4f0d923..5093c38 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,6 +30,23 @@ FROM python:3.9-slim ENV TZ=Asia/Shanghai RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +# 清空所有默认源 +RUN rm -rf /etc/apt/sources.list.d/* && \ + rm -f /etc/apt/sources.list + +# 替换为阿里云源 +RUN echo "\ + deb https://mirrors.aliyun.com/debian/ bookworm main non-free-firmware contrib\n\ + deb-src https://mirrors.aliyun.com/debian/ bookworm main non-free-firmware contrib\n\ + deb https://mirrors.aliyun.com/debian/ bookworm-updates main non-free-firmware contrib\n\ + deb-src https://mirrors.aliyun.com/debian/ bookworm-updates main non-free-firmware contrib\n\ + deb https://mirrors.aliyun.com/debian/ bookworm-backports main non-free-firmware contrib\n\ + deb-src https://mirrors.aliyun.com/debian/ bookworm-backports main non-free-firmware contrib\n\ + deb https://mirrors.aliyun.com/debian-security bookworm-security main non-free-firmware contrib\n\ + deb-src https://mirrors.aliyun.com/debian-security bookworm-security main non-free-firmware contrib\n\ + " > /etc/apt/sources.list + + # 安装运行时依赖 RUN apt-get update && apt-get install -y --no-install-recommends \ curl \