Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dockerfile/mongodb
MongoDB Dockerfile for trusted automated Docker builds.
https://github.com/dockerfile/mongodb
Last synced: 3 months ago
JSON representation
MongoDB Dockerfile for trusted automated Docker builds.
- Host: GitHub
- URL: https://github.com/dockerfile/mongodb
- Owner: dockerfile
- License: mit
- Created: 2014-01-11T09:00:39.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2017-12-29T03:36:14.000Z (about 7 years ago)
- Last Synced: 2024-08-01T17:23:24.841Z (6 months ago)
- Language: Shell
- Homepage: http://dockerfile.github.io/#/mongodb
- Size: 329 KB
- Stars: 325
- Watchers: 25
- Forks: 235
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-mongodb - Dockerfile
README
## MongoDB Dockerfile
This repository contains **Dockerfile** of [MongoDB](http://www.mongodb.org/) for [Docker](https://www.docker.com/)'s [automated build](https://registry.hub.docker.com/u/dockerfile/mongodb/) published to the public [Docker Hub Registry](https://registry.hub.docker.com/).
### Base Docker Image
* [dockerfile/ubuntu](http://dockerfile.github.io/#/ubuntu)
### Installation
1. Install [Docker](https://www.docker.com/).
2. Download [automated build](https://registry.hub.docker.com/u/dockerfile/mongodb/) from public [Docker Hub Registry](https://registry.hub.docker.com/): `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/db --name mongodb dockerfile/mongodb
#### Run `mongod` w/ HTTP support
docker run -d -p 27017:27017 -p 28017:28017 --name mongodb dockerfile/mongodb mongod --rest --httpinterface
#### Run `mongod` w/ Smaller default file size
docker run -d -p 27017:27017 --name mongodb dockerfile/mongodb mongod --smallfiles
#### Run `mongo`
docker run -it --rm --link mongodb:mongodb dockerfile/mongodb bash -c 'mongo --host mongodb'
##### 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.