Created
August 4, 2016 11:47
-
-
Save seveniu/20e5462bcf7ae76fa20f91d5b67f0b39 to your computer and use it in GitHub Desktop.
MongoDB Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# MongoDB Dockerfile | |
# | |
# https://github.com/dockerfile/mongodb | |
# | |
# Pull base image. | |
FROM ubuntu:14.04 | |
# Install MongoDB. | |
RUN \ | |
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 && \ | |
echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list && \ | |
apt-get update && \ | |
apt-get install -y mongodb-org && \ | |
rm -rf /var/lib/apt/lists/* | |
RUN mkdir -p /data/mongodb/db | |
RUN mkdir -p /data/mongodb/log | |
ADD mongod.conf /etc/mongod.conf | |
# Define mountable directories. | |
VOLUME ["/data/mongodb"] | |
# Define working directory. | |
#WORKDIR /data | |
# Define default command. | |
CMD ["mongod","--config","/etc/mongod.conf","--httpinterface","--rest"] | |
# Expose ports. | |
# - 27017: process | |
# - 28017: http | |
EXPOSE 27017 | |
EXPOSE 28017 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment