Open Vid201 opened 4 years ago
Found the cause for the error. The error occurs in script generate-openapi-demo-specs.sh on line 32:
docker run --rm -e GOPATH=$HOME/go:/go -v $HOME:$HOME -w $(pwd) ${IMAGE}:${IMAGE_VERSION} $command
Because volume is mounted to $HOME, the project's location must be somewhere inside folder $HOME (/home/username). Maybe this should be mentioned somewhere.
I have the same problem. I tried it under Windows 10 with Ubuntu 20.04 LTS as well as openSUSE-Leap-15-1, with project being in /home/myusername (I tried other locations as well, e.g. /home). The make run always results in "open build/rest/openapi/spec/openAPI.yml: no such file or directory", even if all the files and directories do exist.
When I tested it in Play with docker the OpenAPI demo ran normally.
But when I changed the line 32 in script generate-openapi-demo-specs.sh: from: docker run --rm -e GOPATH=$HOME/go:/go -v $HOME:$HOME -w $(pwd) ${IMAGE}:${IMAGE_VERSION} $command to: docker run --rm -e GOPATH=$HOME/go:/go -v $(pwd):$(pwd) -w $(pwd) ${IMAGE}:${IMAGE_VERSION} $command
the makefile completed without errors and docker images ran normally.
But when I changed the line 32 in script generate-openapi-demo-specs.sh: from:
docker run --rm -e GOPATH=$HOME/go:/go -v HOME:(pwd) IMAGE:{IMAGE_VERSION} $command
to:docker run --rm -e GOPATH=$HOME/go:/go -v $(pwd):$(pwd) -w $(pwd){IMAGE}:${IMAGE_VERSION} $command
the makefile completed without errors and docker images ran normally.
It's work.
Could you please submit a pull request to fix this?
What I'm trying to do
I am trying to run OpenAPI demo (https://github.com/hyperledger/aries-framework-go/blob/master/docs/rest/openapi_demo.md). I am using Windows 10 with Ubuntu 20.04 LTS and Docker Desktop (WSL 2).
Expected result
Two agents are started - Alice and Bob.
Actual result
make run-openapi-demo throws error (file with that path exists inside folder aries-framework-go):
Generate demo agent rest controller API specifications using Open API 2020/08/10 10:49:11 args[0] = build/rest/openapi/spec/openAPI.yml 2020/08/10 10:49:11 args[1:] = [test/bdd/fixtures/demo/openapi/specs/localhost:10081.yml] open build/rest/openapi/spec/openAPI.yml: no such file or directory make: *** [Makefile:93: generate-openapi-demo-specs] Error 1