Skip to content

fix: improve build reliability with fallback apt mirrors #18155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions dogfood/coder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
FROM rust:slim@sha256:3f391b0678a6e0c88fd26f13e399c9c515ac47354e3cadfee7daee3b21651a4f AS rust-utils
# Install rust helper programs
ENV CARGO_INSTALL_ROOT=/tmp/
RUN apt-get update
RUN apt-get install -y libssl-dev openssl pkg-config build-essential
# Use more reliable mirrors for Debian packages
RUN sed -i 's|http://deb.debian.org/debian|http://mirrors.edge.kernel.org/debian|g' /etc/apt/sources.list && \
apt-get update || true
RUN apt-get update && apt-get install -y libssl-dev openssl pkg-config build-essential
RUN cargo install jj-cli typos-cli watchexec-cli

FROM ubuntu:jammy@sha256:0e5e4a57c2499249aafc3b40fcd541e9a456aab7296681a3994d631587203f97 AS go
Expand Down Expand Up @@ -119,7 +121,10 @@ RUN mkdir -p /etc/sudoers.d && \
chmod 750 /etc/sudoers.d/ && \
chmod 640 /etc/sudoers.d/nopasswd

RUN apt-get update --quiet && apt-get install --yes \
# Use more reliable mirrors for Ubuntu packages
RUN sed -i 's|http://archive.ubuntu.com/ubuntu/|http://mirrors.edge.kernel.org/ubuntu/|g' /etc/apt/sources.list && \
sed -i 's|http://security.ubuntu.com/ubuntu/|http://mirrors.edge.kernel.org/ubuntu/|g' /etc/apt/sources.list && \
apt-get update --quiet && apt-get install --yes \
ansible \
apt-transport-https \
apt-utils \
Expand Down Expand Up @@ -334,11 +339,15 @@ RUN curl --silent --show-error --location --output /usr/local/bin/cloud_sql_prox
curl --silent --show-error --location --output /usr/local/bin/cosign "https://github.com/sigstore/cosign/releases/download/v${COSIGN_VERSION}/cosign-linux-amd64" && \
chmod a=rx /usr/local/bin/cosign && \
# Install Bun JavaScript runtime to /usr/local/bin
# Ensure unzip is installed right before using it and use multiple mirrors for reliability
(apt-get update || (sed -i 's|http://archive.ubuntu.com/ubuntu/|http://mirrors.edge.kernel.org/ubuntu/|g' /etc/apt/sources.list && apt-get update)) && \
apt-get install -y unzip && \
curl --silent --show-error --location --fail "https://github.com/oven-sh/bun/releases/download/bun-v${BUN_VERSION}/bun-linux-x64.zip" --output /tmp/bun.zip && \
unzip -q /tmp/bun.zip -d /tmp && \
mv /tmp/bun-linux-x64/bun /usr/local/bin/ && \
chmod a=rx /usr/local/bin/bun && \
rm -rf /tmp/bun.zip /tmp/bun-linux-x64
rm -rf /tmp/bun.zip /tmp/bun-linux-x64 && \
apt-get clean && rm -rf /var/lib/apt/lists/*

# We use yq during "make deploy" to manually substitute out fields in
# our helm values.yaml file. See https://github.com/helm/helm/issues/3141
Expand Down
Loading