I'm new to Go & Beego.

When I build docker image with beego's default docker file, it shows this error :

godep: No Godeps found (or in any parent directory)

The build info is:

Sending build context to Docker daemon   13.6MB
Step 1/9 : FROM library/golang
 ---> 138bd936fa29
Step 2/9 : RUN go get github.com/tools/godep
 ---> Running in 9003355d967f
 ---> bae9e4289f9b
Removing intermediate container 9003355d967f
Step 3/9 : RUN CGO_ENABLED=0 go install -a std
 ---> Running in 63d367bd487e
 ---> 3ce0b2d47c0a
Removing intermediate container 63d367bd487e
Step 4/9 : ENV APP_DIR $GOPATH/src/TestProject
 ---> Running in 53ddc4661a07
 ---> 528794352eb0
Removing intermediate container 53ddc4661a07
Step 5/9 : RUN mkdir -p $APP_DIR
 ---> Running in 37718f358f5c
 ---> ef9332ca086c
Removing intermediate container 37718f358f5c
Step 6/9 : ENTRYPOINT (cd $APP_DIR && ./TestProject)
 ---> Running in 059c06321914
 ---> 8538ea070871
Removing intermediate container 059c06321914
Step 7/9 : ADD . $APP_DIR
 ---> df129482c662
Step 8/9 : RUN cd $APP_DIR && CGO_ENABLED=0 godep go build -ldflags '-d -w -s'
 ---> Running in 50b29d1307b5
godep: No Godeps found (or in any parent directory)
The command '/bin/sh -c cd $APP_DIR && CGO_ENABLED=0 godep go build -ldflags '-d -w -s'' returned a non-zero code: 1
1

There are 1 best solutions below

0
On

The solution is very simple: run godep save in your project locally, and you will go a new folder Godeps in your project. it contains file:Godeps.json. After this, run docker build . again, you will got your docker image.