不替换的话,无法安装 curl
=> [internal] load metadata for mcr.microsoft.com/dotnet/aspnet:7.0 1.3s
=> [internal] load metadata for mcr.microsoft.com/dotnet/sdk:7.0
...
> [base 4/4] RUN apt-get update && apt-get install -y curl:
#15 0.972 Get:1 http://deb.debian.org/debian bullseye InRelease [116 kB]
...
#15 266.2 E: Failed to fetch http://deb.debian.org/debian/pool/main/b/brotli/libbrotli1_1.0.9-2%2bb2_amd64.deb Connection timed out [IP: 151.101.110.132 80]
#15 266.2 E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
------
executor failed running [/bin/sh -c apt-get update && apt-get install -y curl]: exit code: 100
在 dockerfile 中添加下面的指令解决了
RUN sed -i s@/deb.debian.org/@/mirrors.aliyun.com/@g /etc/apt/sources.list
RUN sed -i s@/security.debian.org/@/mirrors.aliyun.com/@g /etc/apt/sources.list
sed命令
参见https://stackoverflow.com/questions/62034545/dockerfile-how-to-set-apt-mirror-based-on-the-ubuntu-release