我有一个使用 Golang 的应用程序,我想“dockerize”它,基于本教程
这是项目结构:
Dockerfile:
FROM golang:1.12.7-alpine3.9
RUN mkdir /app
ADD . /app
WORKDIR /app
RUN go build -o main .
CMD ["/app/main"]
当我尝试运行此命令时:
docker build -t pln-monitoring .
它显示了这个错误:
Step 5/6 : RUN go build -o main .
---> Running in 5e3c84f1435d
main.go:12:2: cannot find package "github.com/geshtng/pln-monitoring/middleware" in any of:
/usr/local/go/src/github.com/geshtng/pln-monitoring/middleware (from $GOROOT)
/go/src/github.com/geshtng/pln-monitoring/middleware (from $GOPATH)
main.go:13:2: cannot find package "github.com/geshtng/pln-monitoring/pkg/common/config" in any of:
/usr/local/go/src/github.com/geshtng/pln-monitoring/pkg/common/config (from $GOROOT)
/go/src/github.com/geshtng/pln-monitoring/pkg/common/config (from $GOPATH)
人到中年有点甜
相关分类