Sign inSign up

casperfrx/mongodb-shell

By casperfrx

Updated over 6 years ago

A dockerized wrapper for the MongoDB Shell.

Image
1

697

casperfrx/mongodb-shell repository overview

MongoDB Shell Docker Container

This is a Docker container running MongoDB Shell as a one-line command.

It is meant to be run with the --rm parameter so the container gets discarded right away.

Usage

docker run -it --rm -v /path/to/data:/data -v /path/to/.mongorc.js:/home/mongo/.mongorc.js --user $(id -u):$(id -g) casperfrx/mongodb-shell <MongoDB Access URL>

If no MongoDB server URL is given, the command falls back to the --help parameter.

(Optional): Add to .bashrc / profile

To run the container as if it was a native command, add this line to .bashrc/.profile: alias mongo="docker run -it --rm -v /path/to/data:/data -v /path/to/.mongorc.js:/home/mongo/.mongorc.js --user $(id -u):$(id -g) casperfrx/mongodb-shell"

Now you can just run: mongo <MongoDB Access URL>

Tag summary

Content type

Image

Digest

Size

37.8 MB

Last updated

over 6 years ago

docker pull casperfrx/mongodb-shell