moby icon indicating copy to clipboard operation
moby copied to clipboard

Dockerfile: use default apt mirrors

Open crazy-max opened this issue 2 years ago • 2 comments

follow-up https://github.com/moby/moby/pull/44546#discussion_r1059776409

- What I did

Removes APT_MIRROR added in https://github.com/moby/moby/pull/39537 as I don't think we need an alternative mirror anymore. Also removes BUILD_APT_MIRROR added in https://github.com/moby/moby/pull/26375 that does not seem to be used.

- How I did it

- How to verify it

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

crazy-max avatar Jan 03 '23 09:01 crazy-max

I wonder if we should completely remove it from the Dockerfile;

  • is this useful for people behind the GFW, or not needed there?
  • does "apt" / "apt-get" have alternatives that allow passing (through env-vars?) would be nice, but don't think there is

That said; currently we unconditionally call sed to replace the config; perhaps we shouldn't and only do so if APT_MIRROR is non-empty.

thaJeztah avatar Jan 03 '23 09:01 thaJeztah

I agree with @thaJeztah , I'd prefer to retain APT_MIRROR in Dockerfile and Makefile. Can be removed from Jenkinsfile though.

AkihiroSuda avatar Jan 03 '23 10:01 AkihiroSuda

Got many issue with the fastly CDN recently:

> [linux/amd64->arm64 containerd-build 2/3] RUN --mount=type=cache,sharing=locked,id=moby-containerd-aptlib,target=/var/lib/apt     --mount=type=cache,sharing=locked,id=moby-containerd-aptcache,target=/var/cache/apt         
apt-get update && xx-apt-get install -y --no-install-recommends             gcc libbtrfs-dev libsecret-1-dev:
100.8 E: Failed to fetch http://cdn-fastly.deb.debian.org/debian-security/pool/updates/main/u/util-linux/libmount-dev_2.36.1-8%2bdeb11u1_arm64.deb  Cannot initiate the connection to cdn-fastly.deb.debian.org:80 (2a04:4e42:6a::644). - connect (101: Network is unreachable) [IP: 199.232.170.132 80]
100.8 E: Failed to fetch http://cdn-fastly.deb.debian.org/debian/pool/main/p/pcre3/libpcre16-3_8.39-13_arm64.deb  Cannot initiate the connection to cdn-fastly.deb.debian.org:80 (2a04:4e42:6a::644). - connect (101: Network is unreachable) [IP: 199.232.170.132 80]
100.8 E: Failed to fetch http://cdn-fastly.deb.debian.org/debian/pool/main/p/pcre3/libpcre32-3_8.39-13_arm64.deb  Cannot initiate the connection to cdn-fastly.deb.debian.org:80 (2a04:4e42:6a::644). - connect (101: Network is unreachable) [IP: 199.232.170.132 80]
100.8 E: Failed to fetch http://cdn-fastly.deb.debian.org/debian/pool/main/g/gcc-10/libstdc%2b%2b6_10.2.1-6_arm64.deb  Cannot initiate the connection to cdn-fastly.deb.debian.org:80 (2a04:4e42:6a::644). - connect (101: Network is unreachable) [IP: 199.232.170.132 80]
100.8 E: Failed to fetch http://cdn-fastly.deb.debian.org/debian/pool/main/p/pcre3/libpcrecpp0v5_8.39-13_arm64.deb  Cannot initiate the connection to cdn-fastly.deb.debian.org:80 (2a04:4e42:6a::644). - connect (101: Network is unreachable) [IP: 199.232.170.132 80]
100.8 E: Failed to fetch http://cdn-fastly.deb.debian.org/debian/pool/main/p/pcre3/libpcre3-dev_8.39-13_arm64.deb  Cannot initiate the connection to cdn-fastly.deb.debian.org:80 (2a04:4e42:6a::644). - connect (101: Network is unreachable) [IP: 199.232.170.132 80]
100.8 E: Failed to fetch http://cdn-fastly.deb.debian.org/debian-security/pool/updates/main/z/zlib/zlib1g-dev_1.2.11.dfsg-2%2bdeb11u2_arm64.deb  Cannot initiate the connection to cdn-fastly.deb.debian.org:80 (2a04:4e42:6a::644). - connect (101: Network is unreachable) [IP: 199.232.170.132 80]
100.8 E: Failed to fetch http://cdn-fastly.deb.debian.org/debian/pool/main/g/glib2.0/libglib2.0-dev_2.66.8-1_arm64.deb  Cannot initiate the connection to cdn-fastly.deb.debian.org:80 (2a04:4e42:6a::644). - connect (101: Network is unreachable) [IP: 199.232.170.132 80]
100.8 E: Failed to fetch http://cdn-fastly.deb.debian.org/debian/pool/main/libs/libsecret/libsecret-1-dev_0.20.4-2_arm64.deb  Cannot initiate the connection to cdn-fastly.deb.debian.org:80 (2a04:4e42:6a::644). - connect (101: Network is unreachable) [IP: 199.232.170.132 80]
100.8 E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
------
Dockerfile:208
--------------------
 207 |     ARG TARGETPLATFORM
 208 | >>> RUN --mount=type=cache,sharing=locked,id=moby-containerd-aptlib,target=/var/lib/apt \
 209 | >>>     --mount=type=cache,sharing=locked,id=moby-containerd-aptcache,target=/var/cache/apt \
 210 | >>>         apt-get update && xx-apt-get install -y --no-install-recommends \
 211 | >>>             gcc libbtrfs-dev libsecret-1-dev
 212 |     ARG DOCKER_STATIC
--------------------
ERROR: failed to solve: process "/bin/sh -c apt-get update && xx-apt-get install -y --no-install-recommends             gcc libbtrfs-dev libsecret-1-dev" did not complete successfully: exit code: 100

Would appreciate to have this one in :pray:

crazy-max avatar Jun 28 '23 22:06 crazy-max

The reason we added the knob was to work around mirrors having issues (and even deb.debian.org which was supposed to route to the best mirror for you).

cpuguy83 avatar Jun 29 '23 14:06 cpuguy83

I think this is the best middle ground; unconditionally using Fastly isn't great. We should also consider not overriding security.debian.org since many mirrors do not carry the debian-security repo, but that can be a follow-up.

neersighted avatar Jun 29 '23 14:06 neersighted