我的文件FROM golang:1.10.2-alpine3.7 AS buildRUN apk --no-cache add gcc g++ make ca-certificatesRUN apk add gitWORKDIR /go/src/github.com/meowerCOPY Gopkg.lock Gopkg.toml ./COPY util utilCOPY event eventCOPY db dbCOPY search searchCOPY schema schemaCOPY meow-service meow-serviceCOPY query-service query-serviceCOPY pusher-service pusher-serviceRUN go get -d -v ./...RUN go install ./...FROM alpine:3.7WORKDIR /usr/binCOPY --from=build /go/bin .我添加了 apk add git line.Without 这条线我的 docker-compose up 产生了Step 13/17 : RUN go get -d -v ./... ---> Running in d917adba00cdgithub.com/lib/pq (download)go: missing Git command. See https://golang.org/s/gogetcmdpackage github.com/lib/pq: exec: "git": executable file not found in $PATHgithub.com/nats-io/go-nats (download)go: missing Git command. See https://golang.org/s/gogetcmdpackage github.com/nats-io/go-nats: exec: "git": executable file not found in $PATHgithub.com/gorilla/mux (download)go: missing Git command. See https://golang.org/s/gogetcmdpackage github.com/gorilla/mux: exec: "git": executable file not found in $PATHgithub.com/kelseyhightower/envconfig (download)go: missing Git command. See https://golang.org/s/gogetcmdpackage github.com/kelseyhightower/envconfig: exec: "git": executable file not found in $PATHpackage github.com/retry: invalid github.com/ import path "github.com/retry"github.com/segmentio/ksuid (download)go: missing Git command. See https://golang.org/s/gogetcmdpackage github.com/segmentio/ksuid: exec: "git": executable file not found in $PATHgithub.com/gorilla/websocket (download)go: missing Git command. See https://golang.org/s/gogetcmdpackage github.com/gorilla/websocket: exec: "git": executable file not found in $PATHgithub.com/olivere/elastic (download)go: missing Git command. See https://golang.org/s/gogetcmdpackage github.com/olivere/elastic: exec: "git": executable file not found in $PATH这是什么意思?
1 回答
MMMHUHU
TA贡献1834条经验 获得超8个赞
go get
在内部调用用于托管要获取的包的特定 VCS 的“参考”客户端工具。换句话说,go get
它本身不知道如何与 VCS 服务器交互。
所以是的,为了go get
一个由 Git 托管的包,您需要提供可调用git
二进制文件的工作 Git 安装。
至于你的第二个问题,它似乎与 Go 没有任何关系,所以我建议你做一些研究,然后问一个单独的问题,alpine
如果失败的话。
- 1 回答
- 0 关注
- 135 浏览
添加回答
举报
0/150
提交
取消