From 6050ade6b4a0e8f04102053b2813932f3e63994e Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 18 Nov 2026 09:45:20 +0000 Subject: [PATCH] Take Alpine's security fixes in each image build The released image still has zlib 1.3.2-r1 (CVE-2026-4738), so the Security workflow's image scan fails. Upgrade the runtime stage's packages and build that stage without the cache when publishing, as plasto and the other apps do. The scan passes once the next release is published. --- .github/workflows/ci.yml | 2 ++ Dockerfile | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7daf22c..57e0c74 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,6 +96,8 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha + # Run the runtime stage fresh, so each release takes Alpine's latest security fixes. + no-cache-filters: runtime cache-to: type=gha,mode=max # A signed statement of which workflow and commit built the image; check it with # `gh attestation verify oci://: --repo /`. diff --git a/Dockerfile b/Dockerfile index 3d37eb3..171fd77 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,8 +18,10 @@ COPY backend/ ./ RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH GOARM=${TARGETVARIANT#v} go build -trimpath -ldflags="-s -w" -o /should-we . # --- runtime --- -FROM alpine:3.24@sha256:f59abe656b692d901e184be3445e084786602108599d2a51d229c0f5a48c71bf -RUN apk add --no-cache ca-certificates tzdata +FROM alpine:3.24@sha256:f59abe656b692d901e184be3445e084786602108599d2a51d229c0f5a48c71bf AS runtime +# Take Alpine's security fixes now rather than waiting for the base image to be rebuilt. +RUN apk upgrade --no-cache \ + && apk add --no-cache ca-certificates tzdata WORKDIR /app COPY --from=backend /should-we /app/should-we COPY --from=web /web/dist /app/pb_public