build(image): rebuild the apt-get upgrade layer when APT_REFRESH changes
A build cache kept the upgrade layer for as long as nothing above it changed, so a publish shipped curl and librsvg a release behind fixes already in the Debian archive (the CVE gate refused it). The release build passes the day; empty, the default for a self-hosted build, leaves the cache alone.
This commit is contained in:
+7
-1
@@ -55,8 +55,14 @@ RUN adduser --disabled-password --gecos "" appuser \
|
|||||||
# token, else only storyboards are offered). yt-dlp auto-detects deno on PATH.
|
# token, else only storyboards are offered). yt-dlp auto-detects deno on PATH.
|
||||||
# `apt-get upgrade`: the base image is a snapshot, and the Debian security fixes released since it
|
# `apt-get upgrade`: the base image is a snapshot, and the Debian security fixes released since it
|
||||||
# was cut are only in the archive — the first Trivy scan found one (pcre2) fixed upstream but not in it.
|
# was cut are only in the archive — the first Trivy scan found one (pcre2) fixed upstream but not in it.
|
||||||
|
# APT_REFRESH: the upgrade only runs when this layer is rebuilt, and a build cache keeps it for as long
|
||||||
|
# as nothing above it changes — a publish shipped an image whose curl and librsvg were a release behind
|
||||||
|
# fixes already in the archive. The release build passes the day here, so the layer is rebuilt at
|
||||||
|
# least daily; empty (the default, a self-hosted build) leaves the cache alone.
|
||||||
ARG DENO_VERSION=v2.9.1
|
ARG DENO_VERSION=v2.9.1
|
||||||
RUN apt-get update \
|
ARG APT_REFRESH=
|
||||||
|
RUN echo "apt refresh: ${APT_REFRESH:-cached}" \
|
||||||
|
&& apt-get update \
|
||||||
&& apt-get upgrade -y --no-install-recommends \
|
&& apt-get upgrade -y --no-install-recommends \
|
||||||
&& apt-get install -y --no-install-recommends ffmpeg intel-media-va-driver unzip curl ca-certificates \
|
&& apt-get install -y --no-install-recommends ffmpeg intel-media-va-driver unzip curl ca-certificates \
|
||||||
&& curl -fsSL "https://github.com/denoland/deno/releases/download/${DENO_VERSION}/deno-x86_64-unknown-linux-gnu.zip" -o /tmp/deno.zip \
|
&& curl -fsSL "https://github.com/denoland/deno/releases/download/${DENO_VERSION}/deno-x86_64-unknown-linux-gnu.zip" -o /tmp/deno.zip \
|
||||||
|
|||||||
Reference in New Issue
Block a user