Dockerfile 846 B

123456789101112131415161718192021222324
  1. # Dockerizing MongoDB: Dockerfile for building MongoDB images
  2. # Based on ubuntu:latest, installs MongoDB following the instructions from:
  3. # http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/
  4. FROM ubuntu:latest
  5. MAINTAINER Docker
  6. # Installation:
  7. # Import MongoDB public GPG key AND create a MongoDB list file
  8. RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
  9. RUN echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | tee /etc/apt/sources.list.d/10gen.list
  10. # Update apt-get sources AND install MongoDB
  11. RUN apt-get update
  12. RUN apt-get install -y -q mongodb-org
  13. # Create the MongoDB data directory
  14. RUN mkdir -p /data/db
  15. # Expose port #27017 from the container to the host
  16. EXPOSE 27017
  17. # Set usr/bin/mongod as the dockerized entry-point application
  18. ENTRYPOINT usr/bin/mongod