
Docker image for moutebank mock server.
mountbank uses port for each imposter (mock).
This is the problem when you run it in the Docker.
At this point you should publish container ports to the host and have the range of free ports to bind.
This solution uses only 2 ports (api and mock).
mockritsa_imposter=NNNNPass env variables to container and expose ports
docker run -d -e PORT_API=1025 -e PORT_MOCK=1026 -p 1025:1025 -p 1026:1026 doochik/mockritsa
Now you can view mountebank interface at localhost:1025 and mock server at localhost:1026.
Example:
curl -X POST 'localhost:1025/imposters' --data @examples/imposter.json (example imposter uses port 42000)$ curl -s 'localhost:1026/api/1.0/test/' --cookie 'mockritsa_imposter=42000'
{
"result": "this is mock response",
"status": "SUCCESS"
}
npm installnpm run devDefault ports at development mode:
Content type
Image
Digest
Size
337 MB
Last updated
over 7 years ago
docker pull doochik/mockritsa