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.
Running the Docker Container
As we have successfully pulled the official mongo image, we can now run that container
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.
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