DEV Community 👩‍💻👨‍💻

Masato Ikeda
Masato Ikeda

Posted on

Run MongoDB sharded cluster in one Docker container

I created a docker image to run a MongoDB sharded cluster in one container. It's hosted on Docker Hub:
https://hub.docker.com/r/a2ikm/sharded-mongo

You can run it like the original mongo image:

$ docker run --rm --publish 27017:27017 a2ikm/sharded-mongo
Enter fullscreen mode Exit fullscreen mode

It should be useful if you run an application on a sharded cluster and also want to run its CI on the same coodination.

Actually, I've introduced it to the CI of mongo_mapper gem. It helps me test it against compatibility changes of MongoDB which affects only a sharded cluster.

If you are interested, please take a look it 😄
Thanks!

Top comments (0)

🌚 Browsing with dark mode makes you a better developer by a factor of exactly 40.

It's a scientific fact.