Run Monika in Docker

Star (0)

Monika is available as a docker image. You can find the image in the docker hub as hyperjump/monika, or pull the image with the following command:

docker pull hyperjump/monika

Once you've pulled the latest image, pass it your monika yaml configuration to the container. From the same directory, you can run:

# Run Monika in foreground
docker run --name monika -v ${PWD}/monika.yml:/config/monika.yml -it hyperjump/monika:latest
# Or, if you prefer to run Monika in the background
docker run --name monika -v ${PWD}/monika.yml:/config/monika.yml --detach hyperjump/monika:latest

In the example above, we create a container from the monika image, map the current directory with a yaml config into the container, and let it run in the backround using the --detach switch.

Once monika is up and running, you can see its log using

docker logs monika

Or you can stop the container with

docker stop monika

For more complex containers, you can pass it monika parameters. Using prometheus with monika in a docker, you would pass the parameters like so:

docker run --name monika_interactive \
-v ${PWD}/myConfig.yml:/config/monika.yml \
-d hyperjump/monika:latest \
monika -c /config/monika.yml --prometheus 3001

Troubleshooting

Genererally when facing issues with your container, try the parameters using regular monika. For instance:

monika -c /config/monika.yml --prometheus 3001

Ensure your container is up and running by running simple commands/parameters:

docker run --name monika_interactive \
-v ${PWD}/myConfig.yml:/config/monika.yml \
-d hyperjump/monika:latest monika --help

For further docker commands and documentation, visit the official Docker documentation here.

If all else fails, hit us up at monika discussions or file an issue.

PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

Copyright © 2022 Hyperjump Tech. All Rights Reserved.