Skip to content

An example of installing mongo shell and tools in a docker container.

Notifications You must be signed in to change notification settings

thelebster/docker-mongodb-shell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

An example of installing mongo shell and tools in a docker container.

  • mongodb-org-shell, contains the mongo shell.
  • mongodb-org-tools, contains the following MongoDB tools: mongoimport bsondump, mongodump, mongoexport, mongofiles, mongorestore, mongostat, and mongotop.
docker build --rm -t thelebster/mongo-shell-example .

docker run -ti --rm --name mongo-shell-example -d thelebster/mongo-shell-example
docker exec -it mongo-shell-example bash
docker run -ti --rm --name mongo-shell-example -v "$PWD"/data:/var/mongo/data -d thelebster/mongo-shell-example

docker exec -it mongo-shell-example mongoexport --host 127.0.0.1 --port 27017 --collection MONGODB_COLLECTION --db MONGODB_NAME --jsonArray --out /var/mongo/data/"$(date +"%m_%d_%Y-%H:%M")".json

docker exec -it mongo-shell-example mongodump --host 127.0.0.1 --port 27017 --db MONGODB_NAME --gzip --archive=/var/mongo/data/"$(date +"%m_%d_%Y-%H:%M")".gz

About

An example of installing mongo shell and tools in a docker container.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published