Open
Description
Go version
go version go1.24.0 darwin/arm64
Output of go env
in your module/workspace:
AR='ar'
CC='clang'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='clang++'
GCCGO='gccgo'
GO111MODULE=''
GOARCH='arm64'
GOARM64='v8.0'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/Users/kmh/Library/Caches/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/Users/kmh/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/vf/f7sq853n33lbw99s6ltplw_00000gp/T/go-build1093759142=/tmp/go-build -gno-record-gcc-switches -fno-common'
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMOD='/dev/null'
GOMODCACHE='/Users/kmh/go/pkg/mod'
GONOPROXY='github.com/kouzoh,github.com/kouzoh-mercoin'
GONOSUMDB='github.com/kouzoh,github.com/kouzoh-mercoin'
GOOS='darwin'
GOPATH='/Users/kmh/go'
GOPRIVATE='github.com/kouzoh,github.com/kouzoh-mercoin'
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/Users/kmh/Library/Application Support/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.24.0'
GOWORK=''
What did you do?
I have a Dockerfile
that looks like this:
FROM golang:1.24-alpine
ENV GOPRIVATE=github.com/<my-org>
ENV GOMODCACHE=/go/pkg/mod
# Set working directory inside the container
WORKDIR /app
# Copy host files to the container
COPY . /app
# Install tools
RUN apk add --no-cache git
RUN go install golang.org/x/pkgsite/cmd/pkgsite@latest
# Download modules to the Go module cache
RUN go mod download github.com/<my-org>/<my-private-repo>@v0.67.2
# Expose the port that pkgsite will use
EXPOSE 8080
# Run pkgsite in cache mode
CMD ["pkgsite", "-http", "0.0.0.0:8080", "-cache"]
What did you see happen?
When running binary, it can load the homepage and I can see that the module did in fact get downloaded if I manually type it into the URL. However, the search doesn't work (nothing appears) and when clicking around I sometimes see errors like this:
2025/05/27 08:04:34 Error: goTagForVersion(""): TagForVersion(""): invalid argument: requested version is not a valid semantic version: ""
What did you expect to see?
The search should work similar to pkg.go.dev today when running in "cache" mode.
Does there need to be another binary within golang.org/x/pkgsite/cmd
in order for this to work, or is just the pkgsite
binary with the -cache
flag sufficient?
Thanks so much ❤