Docker image questions

I am trying to start a prism mock server to work with my swagger.json file.

I’ve tried to use a docker-compose file to do that and that looks like this:
version: ‘2.1’

services:
mock:
container_name: mock-server
image: docker.io/stoplight/prism:3
ports:
- “4010:4010”
volumes:
- ./swagger.json:/tmp/swagger.json
command:
[“mock swagger.json”]

The output from the “docker-compose up” command is the following:
mock-server | prism
mock-server |
mock-server | Commands:
mock-server | prism mock Start a mock server with the given spec file
mock-server |
mock-server | Options:
mock-server | --version Show version number [boolean]
mock-server | --help Show help [boolean]
mock-server |
mock-server | Unknown argument: mock swagger.json
mock-server exited with code 1

If i try to use the output format "prism " i get the following error:
Unknown argument: prism mock swagger.json

Any ideas what i’ve done wrong?

@laur.tanase You’ll want to change the command portion to:

command: mock swagger.json

The way it is currently written, it is getting passed in as a single argument, which is not what you want.

I’ve done this and succeeded to start prism. But i am facing another issue:

mock-server-prism | [CLI] ▒ awaiting Starting Prism▒
mock-server-prism | [HTTP SERVER] ? info Server listening at http://127.0.0.1:4010
mock-server-prism | [CLI] ? note POST http://127.0.0.1:4010/comments
mock-server-prism | [CLI] ? note GET http://127.0.0.1:4010/comments
mock-server-prism | [CLI] ? note GET http://127.0.0.1:4010/comments/{id}
mock-server-prism | [CLI] ? note GET http://127.0.0.1:4010/comments/users
mock-server-prism | [CLI] ? start Prism is listening on http://127.0.0.1:4010

When i try to “curl -X GET http://127.0.0.1:4010/comments” from my machine i get a
“curl: (52) Empty reply from server”. The port mapping should be correct, i use the same compose as above with the command section changed.

Yes, you’ll need Prism to bind to the global interface in order to receive requests from outside the container, this will make the command:

command: mock -h 0.0.0.0 swagger.json