Sign inSign up

lingpin/mongodb

By lingpin

•Updated about 8 years ago

Image
0

1.6K

lingpin/mongodb repository overview

⁠MongoDB Dockerfile

This repository contains Dockerfile of MongoDB⁠ for Docker⁠'s trusted build⁠ published to the public Docker Registry⁠.

⁠Dependencies
⁠Installation
  1. Install Docker⁠.

  2. Download trusted build⁠ from public Docker Registry⁠: docker pull dockerfile/mongodb

    (alternatively, you can build an image from Dockerfile: docker build -t="dockerfile/mongodb" github.com/dockerfile/mongodb)

⁠Usage
⁠Run mongod
docker run -d -p 27017:27017 --name mongodb dockerfile/mongodb
⁠Run mongod w/ persistent/shared directory
docker run -d -p 27017:27017 -v <data-dir>/db:/data/db --name mongodb dockerfile/mongodb
⁠Run mongod w/ HTTP support (requires firewall on port 28017)
docker run -d -p 27017:27017 -p 28017:28017 --name mongodb dockerfile/mongodb mongod --rest --httpinterface
⁠Run mongo
docker run -it --rm --link mongodb:mongodb dockerfile/mongodb bash -c 'mongo --host $MONGODB_PORT_27017_TCP_ADDR'
⁠Usage with VirtualBox (boot2docker-vm)

You will need to set up nat port forwarding with:

VBoxManage modifyvm "boot2docker-vm" --natpf1 "guestmongodb,tcp,127.0.0.1,27017,,27017"  

This will allow you to connect to your mongo container with the standard 'mongo' commands

Tag summary

Content type

Image

Digest

sha256:821a42f30…

Size

300.4 MB

Last updated

almost 11 years ago

docker pull lingpin/mongodb