docker build error #239

Closed
opened 2026-01-19 18:29:33 +00:00 by michael · 0 comments
Owner

Originally created by @changchichung on GitHub.

after git clone the repo , I try to build image from Dokcer file , but with no luck

chchang@hexo:~/docker/transfer$ docker build .
Sending build context to Docker daemon  3.584kB
Step 1/13 : ARG GO_VERSION=1.12
Step 2/13 : FROM golang:${GO_VERSION}-alpine as build
 ---> 841429c8613b
Step 3/13 : RUN apk add git musl-dev
 ---> Using cache
 ---> cf9b5487c055
Step 4/13 : ADD . /go/src/github.com/dutchcoders/transfer.sh
 ---> Using cache
 ---> 71a9a24a4818
Step 5/13 : WORKDIR /go/src/github.com/dutchcoders/transfer.sh
 ---> Using cache
 ---> 979a4a1d8d52
Step 6/13 : ENV GO111MODULE=on
 ---> Using cache
 ---> eacddd06301a
Step 7/13 : RUN go get -u ./... && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags -a -tags netgo -ldflags '-w -extldflags "-static"' -o /go/bin/transfersh github.com/dutchcoders/transfer.sh
 ---> Running in 84c697901995
go: cannot find main module; see 'go help modules'
The command '/bin/sh -c go get -u ./... && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags -a -tags netgo -ldflags '-w -extldflags "-static"' -o /go/bin/transfersh github.com/dutchcoders/transfer.sh' returned a non-zero code: 1

any suggestions ??

Originally created by @changchichung on GitHub. after git clone the repo , I try to build image from Dokcer file , but with no luck ``` chchang@hexo:~/docker/transfer$ docker build . Sending build context to Docker daemon 3.584kB Step 1/13 : ARG GO_VERSION=1.12 Step 2/13 : FROM golang:${GO_VERSION}-alpine as build ---> 841429c8613b Step 3/13 : RUN apk add git musl-dev ---> Using cache ---> cf9b5487c055 Step 4/13 : ADD . /go/src/github.com/dutchcoders/transfer.sh ---> Using cache ---> 71a9a24a4818 Step 5/13 : WORKDIR /go/src/github.com/dutchcoders/transfer.sh ---> Using cache ---> 979a4a1d8d52 Step 6/13 : ENV GO111MODULE=on ---> Using cache ---> eacddd06301a Step 7/13 : RUN go get -u ./... && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags -a -tags netgo -ldflags '-w -extldflags "-static"' -o /go/bin/transfersh github.com/dutchcoders/transfer.sh ---> Running in 84c697901995 go: cannot find main module; see 'go help modules' The command '/bin/sh -c go get -u ./... && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags -a -tags netgo -ldflags '-w -extldflags "-static"' -o /go/bin/transfersh github.com/dutchcoders/transfer.sh' returned a non-zero code: 1 ``` any suggestions ??
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dutchcoders/transfer.sh#239