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’

container_name: mock-server
- “4010:4010”
- ./swagger.json:/tmp/swagger.json
[“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
mock-server-prism | [CLI] ? note POST
mock-server-prism | [CLI] ? note GET
mock-server-prism | [CLI] ? note GET{id}
mock-server-prism | [CLI] ? note GET
mock-server-prism | [CLI] ? start Prism is listening on

When i try to “curl -X GET” 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 swagger.json