system environment centos7
Project directory my_test_server/api
where Dockerfile
FROM golang:latest
WORKDIR $GOPATH/src/my_test_server/api
COPY . $GOPATH/src/my_test_server/api
RUN go build .
EXPOSE 7777
ENTRYPOINT ["./api"]
build image succeeded, but in
docker run-v / home/project/my_test_server/api:/go/src/my_test_server/api
error
Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"./api\": stat ./api: no such file or directory": unknown.
ask questions above humbly < del > Thank you < / del >
PS can only be compiled first, and then run in docker container
.