[关闭]
@bergus 2016-01-19T11:25:44.000000Z 字数 583 阅读 1580

docker MongoDB搭建

docker mongodb


dockerfile

  1. #
  2. # MongoDB Dockerfile
  3. #
  4. # https://github.com/dockerfile/mongodb
  5. #
  6. # Pull base image.
  7. FROM dockerfile/ubuntu
  8. # Install MongoDB.
  9. RUN \
  10. apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 && \
  11. echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' > /etc/apt/sources.list.d/mongodb.list && \
  12. apt-get update && \
  13. apt-get install -y mongodb-org && \
  14. rm -rf /var/lib/apt/lists/*
  15. # Define mountable directories.
  16. VOLUME ["/data/db"]
  17. # Define working directory.
  18. WORKDIR /data
  19. # Define default command.
  20. CMD ["mongod"]
  21. # Expose ports.
  22. # - 27017: process
  23. # - 28017: http
  24. EXPOSE 27017
  25. EXPOSE 28017
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注