Skip to content

Instantly share code, notes, and snippets.

@munanadi
Created July 13, 2021 16:28
Show Gist options
  • Select an option

  • Save munanadi/930e91eabd6dc3ef10917cb3b5412de2 to your computer and use it in GitHub Desktop.

Select an option

Save munanadi/930e91eabd6dc3ef10917cb3b5412de2 to your computer and use it in GitHub Desktop.
Get a local instance of mongodb running with docker.

Steps to follow:

  • docker pull mongo:latest -> to get the images from docker hub
  • docker run -p 2717:27017 -v "ABSOLUTEPATH TO SOME DIR":/data/db --name mymongo mongo -> This would run it in attached mode by deafult
  • docker exec -it mymongo mongo -> Gives you the shell to interact with

Can install docker compass and connect to localhost:2717 to see this as in GUI

🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment