Dockerfile 919 B

123456789101112131415161718192021222324252627282930313233343536
  1. # see also: https://github.com/docker-library/mongo/blob/21869963911a74ccc13697c3ad50cdc23cc79b15/4.1/Dockerfil
  2. FROM mongo:4.1.1-xenial
  3. RUN sed -i 's/archive.ubuntu.com/mirrors.163.com/g' /etc/apt/sources.list
  4. # Install.
  5. RUN \
  6. apt-get update && \
  7. apt-get -y upgrade && \
  8. apt-get install -y curl git unzip vim wget iputils-ping && \
  9. apt-get install -y language-pack-zh-hans && \
  10. apt-get install -y tzdata && \
  11. rm -rf /var/lib/apt/lists/*
  12. RUN locale
  13. # Set environment variables.
  14. ENV HOME /root
  15. ENV LANG=zh_CN.UTF-8\
  16. LANGUAGE=zh_CN:zh:en_US:en\
  17. LC_ALL=zh_CN.UTF-8\
  18. TZ=Asia/Shanghai\
  19. TERM=xterm
  20. RUN ln -fs /usr/share/zoneinfo/$TZ /etc/localtime && \
  21. echo $TZ > /etc/timezone && \
  22. dpkg-reconfigure --frontend noninteractive tzdata
  23. # Define working directory.
  24. WORKDIR $HOME
  25. VOLUME /data/db /data/configdb
  26. ENTRYPOINT ["docker-entrypoint.sh"]
  27. EXPOSE 27017
  28. CMD ["mongod"]