Dockerfile: set GOPATH=/home/crafter/go BEFORE go install layer (was inheriting /root/go)

This commit is contained in:
Kayos 2026-04-29 18:06:02 +00:00
parent 6c8b0528ab
commit 6cd599079b

View file

@ -230,6 +230,11 @@ RUN python3 -m pip install --user --break-system-packages --no-cache-dir pipx \
&& pipx install semgrep && pipx install semgrep
# ============================================================ # ============================================================
# Reset GOPATH to crafter-owned path BEFORE the go install runs as crafter.
# (The /root/go default set in the root-user ENV block fails permission-wise here.)
ENV PATH=/home/crafter/go/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/root/.bun/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/root/go/bin \
GOPATH=/home/crafter/go
# 17. Go user tooling: govulncheck + staticcheck # 17. Go user tooling: govulncheck + staticcheck
# ============================================================ # ============================================================
RUN go install golang.org/x/vuln/cmd/govulncheck@latest \ RUN go install golang.org/x/vuln/cmd/govulncheck@latest \