diff --git a/Dockerfile b/Dockerfile index dd68de8..9347bff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ # ===== 第一阶段:构建阶段 ===== FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build -# 清除所有现有源 -RUN rm -rf /etc/apt/sources.list /etc/apt/sources.list.d/* +# 配置 apt-get 使用 apt-cacher-ng 作为代理 +RUN echo 'Acquire::http::Proxy "http://192.168.1.140:3142";' > /etc/apt/apt.conf.d/01proxy # 配置阿里云镜像源 RUN echo "deb http://mirrors.aliyun.com/debian/ bookworm main contrib non-free" > /etc/apt/sources.list && \ @@ -50,8 +50,8 @@ RUN mkdir -p /app/publish && \ # ===== 第二阶段:运行阶段 ===== FROM mcr.microsoft.com/dotnet/aspnet:8.0 -# 清除所有现有源 -RUN rm -rf /etc/apt/sources.list /etc/apt/sources.list.d/* +# 配置 apt-get 使用 apt-cacher-ng 作为代理 +RUN echo 'Acquire::http::Proxy "http://192.168.1.140:3142";' > /etc/apt/apt.conf.d/01proxy # 配置阿里云镜像源 RUN echo "deb http://mirrors.aliyun.com/debian/ bookworm main contrib non-free" > /etc/apt/sources.list && \