Setting up MongoDB using the Docker containers
The container movement, as I like to call it, has touched almost all the aspects of information technology. Docker, being the tool of choice, is integral to the creating and managing of containers.
In this recipe, we will install Docker on the Ubuntu (14.04) server and run MongoDB in a container.
Getting ready
First, we need to install Docker on our Ubuntu server, which can be done by running this command:
$ wget -qO- https://get.docker.com/ | sh
Start the Docker service:
$ service docker start > docker start/running, process 24369
Confirm that Docker is running as follows:
$ docker info > Containers: 40 > Images: 311 > Storage Driver: aufs > Root Dir: /var/lib/docker/aufs > Dirs: 395 > Execution Driver: native-0.2 > Kernel Version: 3.13.0-37-generic > Operating System: Ubuntu 14.04.2 LTS > WARNING: No swap limit support
How to do it…
Fetch the default MongoDB image from Docker Hub as follows:
$ docker pull mongo...