Pulling the image from Docker Hub
docker pull mongo:latest
Running the image
docker run -d -p 27017:27017 --name=mongo-example mongo:latest
Listing running containers
docker ps
Accessing the MongoDB shell in the running container
docker exec -it mongo-example mongosh
Stopping a container
docker stop <container-id>