How run spotligth prism mock from docker image

Viewed 1833

I am trying to run prism mock server from docker stoplight/prism image, but i didnt found a simple documentation to run from volume (not from http external link)

This is my approach, attach the volume with my local api definitions at 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'

thanks in advance

Edited

After Neo Anderson put me in 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...

Hope helps.

1 Answers

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.

Related