Skip to content

Instantly share code, notes, and snippets.

@fguisso
Last active October 6, 2016 22:59
Create a docker container for run mongodb

Docker with mongoDB

Commands for run and consume a mongodb container

Run

$ docker run -p 27017:27017 --name mongo_db -d fernandoguisso/mongodb

Checking out the logs of a MongoDB container

$ docker logs mongo_db

Playing with MongoDB

First you need mongodb installed in your machine For mac: brew install mongodb For another OS see this link

Start two or more containers

docker run -p 28001:27017 **--name mongo_db_1 -d fernandoguisso/mongodb**

docker run -p 28002:27017 **--name mongo_db_2 -d fernandoguisso/mongodb**
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment