Skip to content

Instantly share code, notes, and snippets.

@touv
Last active March 30, 2016 08:27
Show Gist options
  • Save touv/2d86324db54cac8c7dd1 to your computer and use it in GitHub Desktop.
Save touv/2d86324db54cac8c7dd1 to your computer and use it in GitHub Desktop.
Launch MongoDB via Docker

Create & Run

docker run --net=host --name mongodb -v ${PWD}/.mongodb/data/db:/data/db -p 27017:27017 -d mongo:3.0 --smallfiles

Create the "mongodb" container :

docker create --net=host --name mongodb -v ${PWD}/.mongodb/data/db:/data/db -p 27017:27017  mongo:3.0 --smallfiles

Control the "mongodb" container :

docker start mongodb
docker stop mongodb

Connect to MongoDB Shell :

docker exec -it mongodb mongo

Also

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment