Files
vercel__next.js/.github/next-stats-action.Dockerfile
T
Sebastian "Sebbie" Silbermann f8dc962e17 [ci] Avoid apt-get in the next-stats-action Docker image (#95847)
The `Stats (webpack)` / `Stats (turbopack)` CI jobs have been
intermittently failing on PRs and canary (e.g. [this
run](https://github.com/vercel/next.js/actions/runs/29476089144/job/87563318723)).
The jobs run on arm64 runners, where the `ubuntu:24.04` base image
fetches apt packages from `ports.ubuntu.com`, which is intermittently
unreachable. Since `apt-get update` only warns when index fetches fail,
the Docker build breaks one layer later at `apt-get install` with
"Unable to locate package curl".

This change switches the base image to `buildpack-deps:noble-scm`, which
already ships curl, ca-certificates, and git, so the build no longer
makes any apt calls at all. The `apt-get upgrade` step is dropped along
with it; it was already a silent no-op whenever the mirror was down, and
the ephemeral CI container does not rely on it.

Both `.github/next-stats-action.Dockerfile` (the one CI builds via
`action.yml`) and the duplicate
`.github/actions/next-stats-action/Dockerfile` are updated to stay in
sync.
2026-07-17 10:45:36 -07:00

38 lines
1.1 KiB
Docker

# syntax=docker.io/docker/dockerfile:1
# buildpack-deps already includes curl, ca-certificates, and git, so we avoid
# apt-get entirely (the arm64 apt mirror, ports.ubuntu.com, is unreliable).
FROM buildpack-deps:noble-scm AS base
RUN curl -sfLS https://install-node.vercel.app/v20.9.0 | bash -s -- -f
RUN npm i -g corepack@0.34.6
RUN corepack enable
FROM base AS pnpm-deploy
WORKDIR /dot-github
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY --exclude=actions/*/node_modules \
actions/next-stats-action actions/next-stats-action
RUN pnpm deploy --filter=next-stats-action --production /next-stats
FROM base AS next-stats-action
LABEL com.github.actions.name="Next.js PR Stats"
LABEL com.github.actions.description="Compares stats of a PR with the main branch"
LABEL repository="https://github.com/vercel/next.js"
RUN git config --global user.email 'stats@localhost' && \
git config --global user.name 'next stats'
WORKDIR /next-stats
COPY --from=pnpm-deploy /next-stats .
COPY actions/next-stats-action/entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]