Create docker container times no such file or directory: unknown

  docker, question

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
Report an 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 the above questions modestly.Thank you very much

PS can only be compiled and then run in docker container at present.

If you want to mount it as a directory,/go/src/zy_consumer_server/apiYou have to create it well in advance in the mirror image.
What you created in Dockerfile was$GOPATH/src/my_test_server/apiIs it not a mistake?