2014-05-05 13:17:58 -04:00
|
|
|
# Dockerizing MongoDB: Dockerfile for building MongoDB images
|
2016-07-04 16:29:22 -04:00
|
|
|
# Based on ubuntu:16.04, installs MongoDB following the instructions from:
|
2014-05-05 13:17:58 -04:00
|
|
|
# http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/
|
|
|
|
|
2016-07-04 16:29:22 -04:00
|
|
|
FROM ubuntu:16.04
|
2014-05-05 13:17:58 -04:00
|
|
|
MAINTAINER Docker
|
|
|
|
|
|
|
|
# Installation:
|
|
|
|
# Import MongoDB public GPG key AND create a MongoDB list file
|
2016-07-04 16:29:22 -04:00
|
|
|
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
|
|
|
|
RUN echo "deb http://repo.mongodb.org/apt/ubuntu $(cat /etc/lsb-release | grep DISTRIB_CODENAME | cut -d= -f2)/mongodb-org/3.2 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-3.2.list
|
|
|
|
|
2014-05-05 13:17:58 -04:00
|
|
|
# Update apt-get sources AND install MongoDB
|
2014-07-07 14:06:34 -04:00
|
|
|
RUN apt-get update && apt-get install -y mongodb-org
|
2014-05-05 13:17:58 -04:00
|
|
|
|
|
|
|
# Create the MongoDB data directory
|
|
|
|
RUN mkdir -p /data/db
|
|
|
|
|
|
|
|
# Expose port #27017 from the container to the host
|
|
|
|
EXPOSE 27017
|
|
|
|
|
2014-07-07 14:06:34 -04:00
|
|
|
# Set /usr/bin/mongod as the dockerized entry-point application
|
|
|
|
ENTRYPOINT ["/usr/bin/mongod"]
|