Dockerfile 913 B

1234567891011121314151617181920212223
  1. # Dockerizing MongoDB: Dockerfile for building MongoDB images
  2. # Based on ubuntu:16.04, installs MongoDB following the instructions from:
  3. # http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/
  4. FROM ubuntu:16.04
  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 EA312927
  9. 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
  10. # Update apt-get sources AND install MongoDB
  11. RUN apt-get update && apt-get install -y mongodb-org
  12. # Create the MongoDB data directory
  13. RUN mkdir -p /data/db
  14. # Expose port #27017 from the container to the host
  15. EXPOSE 27017
  16. # Set /usr/bin/mongod as the dockerized entry-point application
  17. ENTRYPOINT ["/usr/bin/mongod"]