Getting MongoDB Container | Docker | Just for fun

 Getting MongoDB Container | Docker | Just for fun 

Getting MongoDB Container | Docker | Just for fun

Today we are going to take a look at, getting the MongoDB container using docker 


List of Contents:- 
  • Getting the Docker image for mongo
  • Running the docker container 
  • Time to get into the machine 


Requirements:- You need to have docker installed in your system ( I will be using my kali-Linux machine for this tutorial which has docker installed in it  ) Check Docker Tutorial here


Getting the Docker image for mongo 

You need to install the docker image for mongo you can either check the Mongo Docker image or you can directory run the 
  • docker run mongo 
I will be using the docker pull mongo command. 

Getting MongoDB Container | Docker | Just for fun


This is going to take a little bit of time, It also depends on the Internet Connection.

Running the Docker Container

As we have successfully pulled the official mongo image, we can now run that container 

Getting MongoDB Container | Docker | Just for fun

As you can see above we run the docker container successfully we have given it a name ( we have used the -d option to run it in the detached mode )

Below that you can see our docker image is up and running...

Time to get into the machine 

Now as we have successfully run the docker container it's time to get into it & if you have read my previous blog you might have known how to get into the docker container. 

Getting MongoDB Container | Docker | Just for fun


As you can see above we have successfully got inside our docker container, we executed the docker exec command to get the /bin/bash shell of the docker container followed by the -it ( i for interactive & t for TTY )

We got mongo up and running the docker container, without having to install it on our bare pc you can run all the mongo commands in it 

Getting MongoDB Container | Docker | Just for fun

As you can see above I have run a basic mongo command above. 


Conclusion:- 

In this tutorial we have only seen the installation of the mongo container using docker, in future blogs, we will be using this container in action. 


Stay Tuned ✌✌

Next Post Previous Post
No Comment
Add Comment
comment url