From 90274e48ddee9ddc172a610912d17ab42c0ab8da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E4=BA=91=E5=91=A8?= <154221037+YunzhouLi-hub@users.noreply.github.com> Date: Fri, 20 Nov 2026 15:00:32 +0800 Subject: [PATCH] build: pin base images to multi-platform digests --- CONTRIBUTING.md | 8 ++++++++ Dockerfile | 8 ++++---- docker-compose.yml | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cc70af0..10a7d19 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,6 +7,14 @@ - **Describe the change.** State the problem, the behavior change and what you tested. A pull request with no description is a request for changes. - **Provider support stays generic.** Any OpenAI- or Anthropic-compatible endpoint works through a model profile; provider convenience goes in as a neutral preset (name and base URL) or a docs recipe, with no vendor logos, promotional codes, baked vendor endpoints, or vendor-specific environment variables. A new wire format needs a schema migration, a profile save/load test, and a live connection test. +## Updating Docker image pins + +The Dockerfile and the PostgreSQL service in `docker-compose.yml` use a readable tag followed +by a digest. Review these pins regularly for upstream security updates. When refreshing a pin, +run `docker buildx imagetools inspect :` and use the top-level index digest. Check +that the index includes `linux/amd64` and `linux/arm64` before proposing the update. Record the +old and new digests in the PR so reviewers can verify the change. + ## Issues - One problem per issue. Include the version or commit, what you ran and what you expected. diff --git a/Dockerfile b/Dockerfile index 183f8cb..f7db0d8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ # ---------------------------------------------------------------- frontend --- # Pinned to the Node 22 line the CI/release workflows use. On the build platform # only; the frontend static export is architecture-independent. -FROM --platform=$BUILDPLATFORM node:22-bookworm-slim AS web +FROM --platform=$BUILDPLATFORM node:22-bookworm-slim@sha256:e9f565d32859f0cbfb52125eafe8be39390f24dac302dc3cdf566e8ba3ab21ee AS web WORKDIR /src/web COPY web/package.json web/package-lock.json ./ RUN npm ci --ignore-scripts @@ -24,7 +24,7 @@ RUN npm run build:static # Pinned to the Go 1.26 line (matches go.mod and the release binaries job). The # binary is CGO-free, so this stage runs on the build platform and cross-compiles # to $TARGETARCH without QEMU. -FROM --platform=$BUILDPLATFORM golang:1.26-bookworm AS build +FROM --platform=$BUILDPLATFORM golang:1.26-bookworm@sha256:dc40a13b61304647ed7e5d581d246b86413dfc29d63c6d018310feb93cd98fc0 AS build WORKDIR /src COPY go.mod go.sum ./ RUN go mod download @@ -52,7 +52,7 @@ RUN ARTEX_SKIP_FRONTEND=1 \ # release channel as the archive, so it catches corrupted or swapped downloads and # moved tags, not a compromised publisher. sqlmap has no release binaries: it is a # shallow clone of a pinned tag, checked against the expected commit. -FROM --platform=$BUILDPLATFORM debian:bookworm-slim AS tools +FROM --platform=$BUILDPLATFORM debian:bookworm-slim@sha256:734a72b3d6142a71993b4bc580ca01d8ca687f77a2c422d96a961d3376b179bc AS tools ARG TARGETARCH ARG NUCLEI_VERSION=v3.11.1 ARG HTTPX_VERSION=v1.12.0 @@ -103,7 +103,7 @@ RUN set -eux; \ rm -rf /opt/sqlmap/.git # ---------------------------------------------------------------- runtime --- -FROM python:3.12-slim-bookworm +FROM python:3.12-slim-bookworm@sha256:935c3c5b12357a7e10caa9c1e6ca5692344d97cf229832ef584be2cec9fc03df ARG TARGETARCH # Common tools: ripgrep / curl / vim, plus a set of recon staples (add/remove as needed). RUN apt-get update && apt-get install -y --no-install-recommends \ diff --git a/docker-compose.yml b/docker-compose.yml index 00e28c5..042aab5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ services: postgres: - image: postgres:16-alpine + image: postgres:16-alpine@sha256:1d5b02d3a9941fbd52437db4107f8c52d6297dac553ca1e5c299ebb3756b4857 environment: POSTGRES_USER: ${POSTGRES_USER:-artex} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?Please set POSTGRES_PASSWORD in .env}