DevOps Articles

Curated articles, resources, tips and trends from the DevOps World.

How To Setup MongoDB In Docker

2 years ago unbiased-coder.com
How To Setup MongoDB In Docker

Summary: This is a summary of an article originally published by the source. Read the full original article here →

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!

Made with pure grit © 2024 Jetpack Labs Inc. All rights reserved. www.jetpacklabs.com