← Back to Pull requests

chore: build the canonical MinIO image from a pinned upstream source (#46) #50

Closed
unknown closed this pull request without merging on Oct 05, 2026 16:51 UTC
View on GitHub
unknown unknown commented on Oct 05, 2026 09:21 UTC
Author

Why

MinIO Community Edition is a source-only distribution and the official public image is gone. Re-verified for this change, not assumed:

| Fact | How verified | Result |
|---|---|---|
| minio/minio upstream state | GitHub API repos/minio/minio | archived: true, default branch master, AGPL-3.0, last push 2026-04-24 |
| Community Edition distribution policy | README.md @ pinned commit | "We will no longer provide pre-compiled binary releases for the community version"; README also states "THIS REPOSITORY IS NO LONGER MAINTAINED." |
| Docker Hub availability | GET hub.docker.com/v2/repositories/minio/minio/tags | {"message":"object not found"} — the repository is deleted, not merely frozen |
| Published release assets | GitHub API releases | RELEASE.2025-10-15T17-29-55Z has 0 binary assets |
| Go version | go.mod @ pinned commit | go 1.24.0, toolchain go1.24.8 |
| Official build instructions | README.md → Build Docker Image | build the binary from source first, then docker build . |

So docker-compose.yml's image: minio/minio:latest had two defects at once:

1. Mutable — :latest means the deployed artifact was not a function of the Git commit.
2. Dead — docker compose up could no longer resolve any minio/minio:<tag>. And the newest image that ever existed would have been frozen below the RELEASE.2025-10-15 fix for CVE-2025-62506.

This is why the issue's original acceptance ("replace with a concrete supported release tag", "traceable to an upstream published release") could not be met honestly. Per the review instruction I widened it to "immutable, traceable official upstream source reference: published tag OR full 40-character commit SHA" and recorded the reasoning on the issue before implementing: #46 comment.

What

Only one thing changes: where the MinIO server binary/image comes from.

  • deploy/minio/Dockerfile (new) — minimal multi-stage build:

  • - builder golang:1.24-alpine3.22 (the Go version comes from upstream's own go.mod); installs bash/perl/git/make because the pinned commit's buildscripts/checkdeps.sh needs them;
    - fetches exactly the pinned SHA from github.com/minio/minio, then re-verifies git rev-parse HEAD equals it;
    - compiles with that commit's own make build target — its Makefile supplies -tags kqueue -trimpath and the ldflags via buildscripts/gen-ldflags.go. No build flags were invented here;
    - fails closed if MINIO_COMMIT is unset or is not a 40-char lowercase hex SHA, so the build can never silently fall through to master;
    - runtime alpine:3.22.6 + curl (the canonical healthcheck shells out to curl) + ca-certificates + tzdata, running as the unprivileged minio user (uid/gid 1000);
    - both base images pinned by multi-arch OCI index digest, not just by version tag — see the review follow-up below.
  • docker-compose.yml — minio now uses build: with MINIO_COMMIT and the auditable local tag beauty-rag-minio:7aac2a2c; image: minio/minio:latest is gone.

  • tests/test_container_image_pins.py (new) — 24 deterministic static guards.

  • docs/deployment-guide.md — operator-facing provenance + license-boundary note.
  • Pinned source reference

    7aac2a2c5b7c882e68c1ce017d8256be2feea27f — committer date 2026-02-12T20:18:48Z, subject "update README.md format and clarify state of the project".

    It is the final commit on master of the archived upstream. I pinned the final upstream state rather than reaching further back for a commit with a more "code-like" diff, and recorded the trade-off rather than glossing over it: this commit touches README.md only, so the compiled Go source is identical to its parent. It is chosen because it post-dates the RELEASE.2025-10-15 CVE fix — the fix the dead public image never received.

    The image carries OCI labels (org.opencontainers.image.revision, io.minio.upstream.commit) so the artifact is auditable back to the commit.

    docker compose config

    Unchanged MinIO contract: expose: ["9001"], minio-data:/minio_data, MINIO_ROOT_USER=${MINIO_ACCESS_KEY:?…} / MINIO_ROOT_PASSWORD=${MINIO_SECRET_KEY:?…}, command: ["minio","server","/minio_data","--console-address",":9001"], the curl healthcheck with interval 30s/timeout 20s/retries 3, restart: unless-stopped, rag-network. Verified identical, and pinned by tests.

    No ENTRYPOINT is set in the image: with an entrypoint, Compose's command list would become minio minio server … and break the server invocation that /api/media presigned URLs depend on.

    Supply-chain guards

    tests/test_container_image_pins.py (25 tests) — no :latest anywhere canonical; no minio/minio: reference; MINIO_COMMIT is a full 40-char lowercase SHA; master/main/latest/HEAD rejected as a source ref; the Dockerfile consumes that ref and validates its shape; no vendored MinIO source and no go install …@latest; every FROM carries a well-formed sha256: digest; the runtime stage selects a non-root USER whose account exists and owns /minio_data; and preservation of the data volume, auth env, ports, command and healthcheck.

    I verified the guards bite by injecting eight regressions — :latest restored, MINIO_COMMIT: master, abbreviated SHA, healthcheck deleted, ENTRYPOINT added, volume swapped, builder reverted to a moving tag, and USER removed — each failed with the intended message, and the clean state returns to 25/25.

    Validation

    | Check | Result |
    |---|---|
    | docker compose config | pass |
    | all four overlays (gpu/cpu/microservices/observability) | pass |
    | scripts/check_repo_consistency.py | pass |
    | ruff check . / ruff format --check . | pass / 279 files formatted |
    | pytest related suites (pins, compose, deploy/, media route, api, consistency) | 629 passed |

    The two overlays initially reported FAIL; that is the pre-existing intentional fail-fast on GF_SECURITY_ADMIN_PASSWORD. I confirmed it reproduces identically on pristine origin/main and that both overlays resolve on base and branch once the variable is supplied — so it is not a regression from this change, and I left it alone.

    What not (explicit non-goals)

  • No backend change. MinIO stays; S3-compatible API, ports, volumes, topology and the Python MinIO SDK usage are untouched.

  • No media route change. /api/media is not touched and was not re-validated end-to-end.

  • No RustFS / no product swap. The fix is provenance, not a migration.

  • No invented image. I did not invent a minio/minio:<tag>; the repository is deleted, so no such reference exists to pin.

  • No vendoring, no relicensing. MinIO source is fetched from official upstream at build time; nothing is copied in and its AGPLv3 license is unchanged.

  • No production / HA / benchmark claim, and no Evidence Level promotion.
  • License / provenance note

    MinIO is an external AGPLv3 dependency built from official upstream source. The source is fetched from github.com/minio/minio at build time and is neither vendored into this repository nor relicensed; org.opencontainers.image.licenses on the built image is AGPL-3.0-only. This records dependency provenance only and is not a legal conclusion — operators remain responsible for their own AGPLv3 obligations.

    Build test — EXECUTED (not blocked)

    docker compose build minio was executed once on this host (Docker 29.5.2):

  • image beauty-rag-minio:7aac2a2c, id sha256:21cf96d6…, 43.9 MB;

  • the compiled binary self-reports minio version DEVELOPMENT.2026-02-12T20-18-48Z (commit-id=7aac2a2c5b7c882e68c1ce017d8256be2feea27f) — direct proof it came from the pinned source;

  • labels, Cmd, empty Entrypoint, /minio_data volume and WorkingDir all match the intended contract.
  • A throwaway single-host container (project minio-pin-smoke, since removed with down -v) reached healthy via the unchanged curl healthcheck, answered /minio/health/live and /minio/health/ready with 200, returned 403 unauthenticated, and answered a SigV4-signed ListBuckets with 200 and valid S3 XML — so the root-credential env contract and the S3 auth path the Python SDK uses both work.

    Runtime evidence

  • Image build from pinned upstream source: executed, pass (single host).

  • Container health / S3 SigV4 auth: executed, pass (single host, ephemeral, local only).

  • Stated in docs/deployment-guide.md as a one-off local run and explicitly not a CI guarantee; contract and guards remain REPO_VERIFIED, and /api/media end-to-end, production and HA remain PENDING.
  • Because the canonical Compose no longer contains the dead public MinIO image reference and* the immutable source contract is complete and build-verified, Closes #46 is used. No other issue is referenced or merged.

    Closes #46

    ---

    Review follow-up (commit b5cdf11)

    Codex review raised two P2 findings. Both were substantive and are fixed; the threads are left unresolved for re-review rather than marked addressed.

    1. golang:1.24-alpine3.22 was described as immutable but is not. A version tag still moves: the Go patch level and the Alpine manifest are rebuilt upstream under the same tag, so the compiler — and therefore the resulting MinIO binary — could change while the Compose image tag and the recorded upstream commit stayed identical. That is the same drift class this issue exists to remove, one layer down. Both base images are now pinned by multi-arch OCI index digest, each keeping a readable tag beside it so the pin stays auditable:

  • golang:1.24-alpine3.22@sha256:3641e0d9b931dc4f2f185dcd669c4679670e9277c8166a838ddb98a2d4389cb5

  • alpine:3.22.6@sha256:5291449c3df73caf6ed85e649dec1b9e818b39a5d8c871e97afc13e9cd5e8fa8
  • The docker buildx imagetools inspect procedure for a deliberate update is recorded in both the Dockerfile and the deployment guide, so the next refresh is a reviewable act.

    2. The runtime stage created an unprivileged minio account but never selected it, so the network-facing storage service still ran as UID 0 — hardening that granted root while implying otherwise. It now sets USER minio (uid/gid 1000, matching the root Dockerfile's app user) and owns /minio_data, so a freshly created volume inherits that ownership.

    Because this change could plausibly break writes, I re-validated rather than assumed: the rebuild was clean, the container reported healthy, id showed uid=1000(minio), and a SigV4 CreateBucket/PUT/GET cycle completed with /minio_data/smoke-bucket on disk owned by minio:minio — so the privilege drop did not trade a root problem for an unwritable data directory.

    Flagged rather than buried: the previous public image ran as root, so a volume it created is root-owned and the non-root process cannot write to it. New deployments need nothing extra; upgrading an existing minio-data volume needs a one-time chown -R 1000:1000, documented in the Dockerfile and docs/deployment-guide.md.

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: Xander-Xai Review duration: 449m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #50"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 20.5% · Safe to merge
    20.5%