ci(docker): go build -mod=mod populates go.sum on the fly

This commit is contained in:
2026-05-05 21:54:05 -07:00
parent ceaf8cab76
commit 50fc1cf497
+6 -7
View File
@@ -41,13 +41,12 @@ WORKDIR /src/explorer
COPY . .
COPY --from=frontend /app/out ./static
# proxy.golang.org has inconsistent caching for hanzoai/[email protected]
# (different POPs serve different zip hashes). Regenerate go.sum from the
# proxy state we actually see at build time and skip sum.golang.org.
RUN rm -f go.sum && GOSUMDB=off go mod download
RUN CGO_ENABLED=1 CGO_CFLAGS="-D_LARGEFILE64_SOURCE" GOSUMDB=off \
go build -trimpath \
# proxy.golang.org caches inconsistently for hanzoai/[email protected]
# (different POPs serve different zip hashes). -mod=mod populates go.sum
# from whatever the proxy serves at build time and GOSUMDB=off skips
# sum.golang.org cross-checks.
RUN rm -f go.sum && CGO_ENABLED=1 CGO_CFLAGS="-D_LARGEFILE64_SOURCE" GOSUMDB=off \
go build -trimpath -mod=mod \
-ldflags="-s -w -X main.version=${VERSION}" \
-o /out/explorer .