mongo run with docker code example
Example 1: docker run commands in mongo
sudo docker run -d -p 27017:27017 --name mongodb mongo:latest
sudo docker start mongodb
sudo docker exec -it mongodb mongo
Example 2: access mongodb running in docker
docker exec -it mongodb bash
mongo