I am trying to run the prism mock server from docker stoplight/prism image, but I didn't find simple documentation to run from volume (not from HTTP external link).
This is my approach: attach the volume with my local API definitions at the local ~/apis directory
@ ~/apis () $ ls
openapi.yml
And run in this way
$ docker run --rm -v ~/apis:/tmp -t stoplight/prism mock -p 4010 --host 0.0.0.0 /tmp/openapi.yaml
[10:16:46 AM] › [CLI] … awaiting Starting Prism…
[10:16:47 AM] › [CLI] ✖ fatal Error opening file "/tmp/openapi.yaml"
ENOENT: no such file or directory, open '/tmp/openapi.yaml'
Edited
After Neo Anderson put me on the right way, I am able to run the mock server in this way :
docker run --rm -v ~/apis:/root/apis -p 9003:4010 -t stoplight/prism mock -h 0.0.0.0 /root/apis/openapi.yml
Watch run docker logs and try the URLs, like this:
http://127.0.0.1:9003/myapi/path...
You are using *.yml in the volume and .yaml in the docker run command.
You may fix it on either side.
Everything else looks good.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With