From c5e1c85f9ea566840c9360165595b4720134354b Mon Sep 17 00:00:00 2001 From: David McKay Date: Mon, 9 Nov 2026 22:02:17 -0800 Subject: [PATCH] Read Ubuntu packages from the Azure mirror, with retries, so a broken primary mirror can't fail image builds archive.ubuntu.com has been serving a noble-updates index whose size disagrees with its release file for hours, failing every image build with "File has unexpected size ... Mirror sync in progress?". The Azure mirror is public and consistent; UBUNTU_MIRROR overrides it. arm64's ports.ubuntu.com sources are left as they are. --- Dockerfile | 7 +++++++ agent-computer/Dockerfile | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/Dockerfile b/Dockerfile index 4f7240df2b..3991806531 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,6 +29,13 @@ ENV BUN_INSTALL=/usr/local ENV PATH="/usr/local/bin:${PATH}" ENV DEBIAN_FRONTEND=noninteractive ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright +# Ubuntu's primary mirror can serve a package index that disagrees with its own release file for +# hours ("File has unexpected size ... Mirror sync in progress?"), and then every build here fails. +# The Azure mirror is public and kept in step, so apt reads from it unless UBUNTU_MIRROR says +# otherwise (arm64 reads ports.ubuntu.com, which this leaves alone). Retries cover a dropped download. +ARG UBUNTU_MIRROR=http://azure.archive.ubuntu.com/ubuntu +RUN sed -i "s#http://archive.ubuntu.com/ubuntu/\?#${UBUNTU_MIRROR}/#; s#http://security.ubuntu.com/ubuntu/\?#${UBUNTU_MIRROR}/#" /etc/apt/sources.list.d/ubuntu.sources \ + && printf 'Acquire::Retries "5";\n' > /etc/apt/apt.conf.d/80-retries COPY --from=node-toolchain /usr/local /usr/local COPY --from=bun-toolchain /usr/local/bin/bun /usr/local/bin/bun # `--no-shell` and the bunx cache: see agent-computer/Dockerfile, which installs the same browser. diff --git a/agent-computer/Dockerfile b/agent-computer/Dockerfile index 18fa5e9ec6..877892b965 100644 --- a/agent-computer/Dockerfile +++ b/agent-computer/Dockerfile @@ -34,6 +34,13 @@ ENV BUN_INSTALL=/usr/local ENV PATH="/usr/local/bin:${PATH}" ENV DEBIAN_FRONTEND=noninteractive ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright +# Ubuntu's primary mirror can serve a package index that disagrees with its own release file for +# hours ("File has unexpected size ... Mirror sync in progress?"), and then every build here fails. +# The Azure mirror is public and kept in step, so apt reads from it unless UBUNTU_MIRROR says +# otherwise (arm64 reads ports.ubuntu.com, which this leaves alone). Retries cover a dropped download. +ARG UBUNTU_MIRROR=http://azure.archive.ubuntu.com/ubuntu +RUN sed -i "s#http://archive.ubuntu.com/ubuntu/\?#${UBUNTU_MIRROR}/#; s#http://security.ubuntu.com/ubuntu/\?#${UBUNTU_MIRROR}/#" /etc/apt/sources.list.d/ubuntu.sources \ + && printf 'Acquire::Retries "5";\n' > /etc/apt/apt.conf.d/80-retries COPY --from=node-toolchain /usr/local /usr/local COPY --from=bun-toolchain /usr/local/bin/bun /usr/local/bin/bun # `--no-shell`: every launch names a Chromium channel (`browser-runtime.ts`), and Playwright runs