I'm having an unexpected behavior when running go get [module]
inside a docker container compared to my local machine and I will appreciate any help to understand the reason for this different behavior.
1) Local machine
Command:
go get github.com/axw/gocov/gocov
Result:
- $GOPATH/bin contains executable
gocov
. - The module was downloaded into $GOPATH/src/github.com/axw/gocov/gocov.
- $GOPATH/pkg doesn't contains anything related to
gocov
package.
2) Docker container
Dockerfile:
This dockerfile is for testing purposes, because of that it doesn't have an entrypoint.
FROM golang:alpine
COPY . /app
WORKDIR /app
RUN go get -v -u github.com/axw/gocov/gocov
RUN ls $GOPATH/bin
RUN ls -laR / | grep "^\/.*gocov.*$"
Result:
- $GOPATH/bin contains executable
gocov
. - $GOPATH/src doesn't contains anything related to
gocov
package. - The module was downloaded into $GOPATH/pkg/mod/github.com/axw/gocov@v1.0.0.