DEV Community

Moh Achun Armando
Moh Achun Armando

Posted on

Run MongoDB with docker

Run the container of mongo image with name mongodb

docker run -d --name mongodb mongo
Enter fullscreen mode Exit fullscreen mode

Execute shell of the container

docker exec -it mongodb sh
Enter fullscreen mode Exit fullscreen mode

inside the container, just type

mongo
Enter fullscreen mode Exit fullscreen mode

Top comments (2)

Collapse
 
atomzwieback profile image
Atomzwieback

Ok and why we need this exactly? A quality post looks other. Its less info than the text on the docker hub for the official image...

Collapse
 
atjhoendz profile image
Moh Achun Armando

thanks for the response sir, i just want to share about my experience how to use it also as a reminder for me and i purposely wrote it like that to show the commands only without too much explanations. This is my first post, thank you for the feedback next time i will improve it.