douer9399
2018-11-03 07:01
浏览 795

“ exec:\” go \”:在$ PATH中找不到可执行文件”

I have created dockerfile, successfully built it, but when I run it

sudo docker run -d -it -p 15555:9888 --name=docker-golang-test goTestDocker go run main.go host=0.0.0.0

it returns an error

docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"go\": executable file not found in $PATH": unknown.

This is my Docker file

FROM golang:1.10.2-alpine3.7 AS build 
RUN apk --no-cache add gcc g++ make ca-certificates
WORKDIR /home/user/Desktop/work/go-work/GoProject/project
RUN ls
RUN pwd
COPY . .
RUN pwd
RUN apk update -qq && apk add git
RUN go get github.com/golang/protobuf/jsonpb
RUN go get github.com/golang/protobuf/proto
FROM alpine:3.7
WORKDIR /usr/bin
COPY --from=build /go/bin .
EXPOSE 9888
CMD ["./app"] --v
  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题