Search code examples
dockertravis-cimountebank

How to start Mountebank in Docker?


How can I use Docker to start Mountebank as a server? I am following this tutorial but I can't make it work.

This error appears:

warn: [mb:2525] dry running injection, use the isDryRun request field in your JavaScript to ignore...
error: [mb:2525] injection X=> SyntaxError: Unexpected token e
error: [mb:2525]     source: "(function(request, logger) { return JSON.parse(request.data).hasOwnProperty('state'); })(scope, logger);"
error: [mb:2525]     scope: {"requestFrom":"","data":"test","isDryRun":true}

The project is open source and CI is Travis. I have cross-posted this discussion to the Mountebank mailing list.


Solution

  • The problem appears to be that the base Docker image is using an old version of mountebank (v1.2.122). I'm not super familiar with Docker, but I assume it's caching the image originally built by Conrad. Your config file works fine with the latest version of mountebank; that just needs to be installed in the Docker container. - https://groups.google.com/forum/#!topic/mountebank-discuss/m-UrVZBR1sQ