MongoDB – Docker Install

Docker and Container making my life great. these days I can explore every thing using this.

I have installed MongoDB quick on my Docker using

Docker pull Mongo

or

docker run –name MyMongo –restart=always -d -p 27017:27017 mongo

this is install MongoDB container on docker.

That’s it!!!. great.

to go to Mongo shell.

to see its created

Docker ps -a

start mongoDB as

Docker start MyMongo

to see its started

Docker ps

to stop the Container

Docker stop MyMongo

To remove /permanently

Docker rm MyMongo

MongoDb is like java programming, it is a developers database.

After start of docker execute (exec) of MyMongo MongoDB interactive (-it) shell(bash)

Docker exec -it MyMongo bash

no you will be on MyMongo container start Mongo Shell

#mongo

Done!!!

>

 

you are now on MongoDB shell to write mongoDB commands (next blog.:).

*Docker is CASE Sensitive

 

 

Advertisements
This entry was posted in MongoDB, NoSQL, Others and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.