Hi Eugene,
The concept you are looking for in bind mounts. This is the ability for a docker container to access the host file system when executing.
The default (for very good security reasons) is to not allow any access.
You will need to specify exactly which folders on the host O/S are available inside the container. You also need to specify where this folder is located (mounted)
docker run -v /home/user:/config
This will make the contents of the /home/user folder available inside the container as /config
Therefore you would change the MB line to --configfile "/config/MyBeautifulConfig.js"
Personally I use docker-compose
I create a file called docker-compose.yml
version: "3.7"
services:
mb:
image: andyrbell/mountebank:latest
container_name: mb
entrypoint: mb start --loglevel info --port 2525 --configfile /config/config.ejs --allowInjection
ports:
- 2525:2525
- 2080:2080
volumes:
- .:/templates
I then start up using
docker-compose -d up
docker-compose in its simplest form is simply a way to manage groups of docker containers without needing long command lines in home grown script files