From c4633ada2839da3167f8842c03d93560f79555a8 Mon Sep 17 00:00:00 2001 From: BoulderBadgeDad Date: Sat, 6 Jun 2026 16:56:23 -0700 Subject: [PATCH] Dockerfile: bust the yt-dlp nightly layer cache per commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI builds with GHA layer caching (cache-from/to: gha), and the nightly RUN's cache key is just the instruction text — the layer could pin a months-old "nightly" across releases, silently defeating the channel's whole purpose. Referencing COMMIT_SHA (already passed by docker-publish.yml) in the RUN makes every new commit bust that one layer while everything above it stays cached. --- Dockerfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f4429b67..566de2c5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,7 +32,12 @@ RUN pip install --no-cache-dir --upgrade pip && \ # yt-dlp must track YouTube faster than its stable channel ships — stable can # lag months behind a breaking YouTube change while extraction is broken # ("Requested format is not available"). Build images with the NIGHTLY channel. -RUN pip install --no-cache-dir -U --pre "yt-dlp[default]" +# COMMIT_SHA is referenced in the RUN so CI's layer cache (cache-from: gha) +# busts on every new commit — otherwise this layer could pin a stale "nightly" +# for months, silently defeating its purpose. +ARG COMMIT_SHA="" +RUN echo "yt-dlp nightly for build ${COMMIT_SHA}" && \ + pip install --no-cache-dir -U --pre "yt-dlp[default]" # Stage 2: Runtime — only runtime dependencies, no build tools FROM python:3.11-slim