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