Source: unbiased-coder.com

How To Setup MongoDB In Docker
How To Setup MongoDB In Docker We will break down this in the following sections: Why running MongoDB in Docker is good How to download and setup MongoDB to run in docker How to keep your MongoDB data persistent

The first command we will be issuing is to download the MongoDB docker container from the docker repository.

It’s useful to interact with the docker container locally for testing things and applications but also to manage it using an admin interface such as MongoDB command line interface d: This demonizes and backgrounds the docker container as soon as it starts Finally we pass on the image name to use to start the docker container instance

$ docker container stop $(docker container ls -q --filter name=mongo) f69baeb1aef2 $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES $ docker container prune WARNING!

Related Articles