Issue Description
The current Dockerfile.ubi9 has an incorrect GOPATH configuration that violates Go's environment variable conventions.
Current Problem
In Dockerfile.ubi9:32, GOPATH is set to /opt/app-root/src/go:
ENV GOPATH /opt/app-root/src/go
However, this is the same directory where the Go installation itself is placed (line 22):
mv /go /opt/app-root/src/go
Why This is Problematic
According to Go documentation (https://go.dev/wiki/InstallTroubleshooting#environment-variables):
- GOROOT should point to the Go installation directory
- GOPATH should point to the workspace directory
- GOPATH should NOT be set to, or contain, the GOROOT directory
The current setup violates this by setting GOPATH to the same location as the Go binaries.
Proposed Solution
Set the environment variables correctly:
ENV GOROOT /opt/app-root/src/go
ENV GOPATH /opt/app-root/src/workspace
This separates the Go installation (GOROOT) from the workspace (GOPATH) as intended by Go's design.
Impact
This could potentially cause issues with Go module resolution and workspace management in containers built from this image.
Issue Description
The current
Dockerfile.ubi9has an incorrect GOPATH configuration that violates Go's environment variable conventions.Current Problem
In
Dockerfile.ubi9:32, GOPATH is set to/opt/app-root/src/go:ENV GOPATH /opt/app-root/src/goHowever, this is the same directory where the Go installation itself is placed (line 22):
Why This is Problematic
According to Go documentation (https://go.dev/wiki/InstallTroubleshooting#environment-variables):
The current setup violates this by setting GOPATH to the same location as the Go binaries.
Proposed Solution
Set the environment variables correctly:
This separates the Go installation (GOROOT) from the workspace (GOPATH) as intended by Go's design.
Impact
This could potentially cause issues with Go module resolution and workspace management in containers built from this image.