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

This commit is contained in:
2026-10-23 15:14:58 +02:00
parent 6300a5b31c
commit 9c4bf1f08b
1508 changed files with 30 additions and 750322 deletions
+6 -5
View File
@@ -21,17 +21,18 @@ ARG GO_BASE=golang@sha256:8ac98ca534ac3f51e1f420a1dd2c15e74c75cfa0f23f3ad27eb5d7
FROM ${GO_BASE} AS build
WORKDIR /src
# **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.
# **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.
COPY go.mod go.sum ./
COPY vendor/ vendor/
ENV GOFLAGS=-mod=mod GOPRIVATE=git.novox.be,github.com/novox
RUN go mod download
# `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 GOFLAGS=-mod=vendor GOPROXY=off go build -trimpath -buildvcs=false \
RUN CGO_ENABLED=0 go build -trimpath -buildvcs=false \
-ldflags "-s -w -X main.version=${VERSION}" \
-o /mesh-controller ./cmd/mesh-controller