Skip to content

Instantly share code, notes, and snippets.

@httpJunkie
Last active February 6, 2020 17:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save httpJunkie/a9a52c8444f7295b45bf40cf7d7dd787 to your computer and use it in GitHub Desktop.
Save httpJunkie/a9a52c8444f7295b45bf40cf7d7dd787 to your computer and use it in GitHub Desktop.
Get started with Docker and Mongo
  1. pull the official image:
docker pull mongo

optionally pull by version:

docker pull mongo:4.2.3
  1. Run in detached mode (background)
docker run -d -p 27017-27019:27017-27019 --name m1 mongo

optionally run by version:

docker run -d -p 27017-27019:27017-27019 --name m1 mongo:4.2.3
  1. Execute shell client in interactive mode:
docker exec -it m1 bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment