hi,
i am trying to build a container that supports modules and i get the
following error:
↳ docker build . -t test
1 ↵
4.91G RAM 0.00K SWP 21:04:00
Sending build context to Docker daemon 16.65MB
Step 1/6 : FROM golang:latest as builder
---> fb7a47d8605b
Step 2/6 : COPY . ./
---> Using cache
---> 95a6b0284991
Step 3/6 : RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o
test ./cmd/test/main.go
---> Running in f09b924aa3e9
$GOPATH/go.mod exists but should not
The command '/bin/sh -c CGO_ENABLED=0 GOOS=linux go build -a -installsuffix
cgo -o test ./cmd/test/main.go' returned a non-zero code: 1
The docker file looks like this.
FROM golang:latest as builder
COPY . ./
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o test
./cmd/test/main.go
FROM scratch
COPY --from=builder test .
CMD ["./test"]
any ideas how to solve this?
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.