Put GOPATH/bin on PATH so go install-ed tools run #6

Merged
benvin merged 1 commits from container-gopath-bin into main 2026-10-03 00:10:09 +10:00
Member

A step that runs go install <tool>@<version> then invokes the tool fails with exit 127: the binary lands in $GOPATH/bin, which nothing adds to PATH, and GOPATH defaults to /root/go. Pipelines moving here from docker.io/golang, where /go/bin is on PATH, break on that difference.

  • Set GOPATH=/go and prepend /go/bin to PATH, matching the official golang images.
  • Create /go/bin mode 1777 so go install also works if the image runs as non-root.
  • Document the installed-tool contract in the README.
A step that runs `go install <tool>@<version>` then invokes the tool fails with exit 127: the binary lands in `$GOPATH/bin`, which nothing adds to `PATH`, and `GOPATH` defaults to `/root/go`. Pipelines moving here from `docker.io/golang`, where `/go/bin` is on `PATH`, break on that difference. - Set `GOPATH=/go` and prepend `/go/bin` to `PATH`, matching the official golang images. - Create `/go/bin` mode 1777 so `go install` also works if the image runs as non-root. - Document the installed-tool contract in the README.
unkin-agent added 1 commit 2026-10-03 00:03:26 +10:00
Put GOPATH/bin on PATH so go install-ed tools run
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
9269d71907
A step that runs `go install <tool>@<version>` and then invokes the tool fails
with exit 127: the binary lands in $GOPATH/bin, which nothing adds to PATH, and
GOPATH defaults to /root/go. Pipelines moving here from docker.io/golang, where
/go/bin is on PATH, break on that difference.

- Set GOPATH=/go and prepend /go/bin to PATH, matching the official golang images.
- Create /go/bin mode 1777 so go install also works if the image runs as non-root.
- Document the installed-tool contract in the README.
benvin merged commit 8b87396475 into main 2026-10-03 00:10:09 +10:00
benvin deleted branch container-gopath-bin 2026-10-03 00:10:09 +10:00
Sign in to join this conversation.