Public Repository

Last pushed: 2 years ago
Short Description
Short description is empty for this repo.
Full Description

Dockerfile

# Pull base image.
FROM ydw918/ubuntu

# Install MongoDB.
RUN \
  apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 && \
  echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' > /etc/apt/sources.list.d/mongodb.list && \
  apt-get update && \
  apt-get install -y mongodb-org && \
  rm -rf /var/lib/apt/lists/*

#
RUN sed -i "s/127.0.0.1/0.0.0.0/g" /etc/mongod.conf

# Define mountable directories.
VOLUME ["/data/db"]

# Define working directory.
WORKDIR /data

# Define default command.
CMD ["mongod"]

# Expose ports.
#   - 27017: process
#   - 28017: http
EXPOSE 27017
EXPOSE 28017

Usage

Run mongod

docker run -d -p 27017:27017 --name mongodb ydw918/mongodb

Run mongod w/ persistent/shared directory

docker run -d -p 27017:27017 -v /data:/data/db --name mongodb ydw918/mongodb

Docker Pull Command
Owner
ydw918