- Docker Desktop on Windows (https://docs.docker.com/docker-for-windows/install)
- Mongodb Management Studio (https://robomongo.org/download)
- Launch Terminal or Command Prompt
- Type
docker --version
to check the version of docker - Pull docker image type
docker pull mongo
(this will get the latest version of mongodb) - Type
docker images
to check list of images downloaded - To run the mongodb type
docker run -p <host-port>:<expose-port> --name mongodb <image-to-use>
- To exit Ctrl+C
- To run in the background (detached mode) type
docker run -d -p 27017-27019:27017-27019 --name mongodb <image-to-use>
- To list all running containers type
docker ps -a
- To stop running container type
docker stop <name-of-container/container-id>
- To remove container type
docker rm <name-of-container/container-id>
- Run again mongodb as detached mode see #7 step
- Use RoboMongo as yung GUI to query data
- Go inside bash docker
docker exec -it <name-of-your-container> bash
docker run --name mongo-test -d -v /mongodb/data/db:/data/db -p 27017:27017 mongo:latest