Revert "Delete vendor/ and the route proxy's: the build module fetches the modules, the root image builds with -mod=mod (issue 1305, C6)"

This reverts commit 9c4bf1f08b.
This commit is contained in:
2026-10-23 16:37:40 +02:00
parent ff543d3def
commit c5b8fca8bd
1508 changed files with 750323 additions and 31 deletions
+5 -6
View File
@@ -21,18 +21,17 @@ ARG GO_BASE=golang@sha256:8ac98ca534ac3f51e1f420a1dd2c15e74c75cfa0f23f3ad27eb5d7
FROM ${GO_BASE} AS build
WORKDIR /src
# **Fetched, not vendored** (novox/hq ADR 0503 §4, issue 1305): the modules come from the module cache or the forge
# the way the build module reads them (`-mod=mod`), the host's validator among them, whose module no public proxy is
# asked for. Dependencies first, so a change to the source does not fetch them again.
# **Nothing is fetched** (novox/hq to-be 45 Phase 1): every dependency is in vendor/, committed, so
# the image builds from this repository alone — the host's validator among them, whose module no
# public proxy is asked for. Dependencies first, so a change to the source does not re-copy them.
COPY go.mod go.sum ./
ENV GOFLAGS=-mod=mod GOPRIVATE=git.novox.be,github.com/novox
RUN go mod download
COPY vendor/ vendor/
# `COPY . .` brings `.git` along, so Go is told not to stamp the commit: the version is said by -X, and a
# rebuild of an unchanged program is the same bytes (novox/hq ADR 0267 rule 6, issue 363).
COPY . .
ARG VERSION=development
RUN CGO_ENABLED=0 go build -trimpath -buildvcs=false \
RUN CGO_ENABLED=0 GOFLAGS=-mod=vendor GOPROXY=off go build -trimpath -buildvcs=false \
-ldflags "-s -w -X main.version=${VERSION}" \
-o /mesh-controller ./cmd/mesh-controller