Setting up MongoDB environment using Docker

Downloading the DB to a local location is easy. However, sometimes problems may occur depending on the operating system and environment. In this situation, we can use Docker. Using DB with Docker can prevent this kind of conflict. From now on, I will show you how to use Mongo DB with Docker on the assumption that you have installed Docker.
requirements
(just) docker
Pull image
Docker Image is all the files and settings for running a specific process. In other words, the form of bundled server programs, source codes and libraries, and compiled executable files required for service operation is called Docker Image. In short, if you have an image, you can use it well without worrying about dependencies.
Let’s pull the MongoDB image.
docker pull mongo
Run
The run command is a bit complicated.
docker run --name practice-mingo -p 37017:27017 -d mongo
--name [project-name]
: make your docker container name for the identifier-p 37017:27017
: Adjust the port to assign31017 -> 27017
checking it’s running
docker ps

If you see a new container called mongo, you can use MongoDB.