Dockerfile 1.0 KB

1234567891011121314151617181920212223242526272829
  1. FROM docker.shemic.com/java/base:latest
  2. MAINTAINER Rabin "https://github.com/shemic"
  3. # set environment variable
  4. ENV HADOOP_HOME=/usr/local/hadoop
  5. ENV HADOOP_CONF_DIR=$HADOOP_HOME/etc/hadoop
  6. ENV HADOOP_VERSION=2.7.3
  7. ENV HADOOP_LOG_DIR=/root/hadoop/logs
  8. ENV YARN_CONF_DIR=$HADOOP_CONF_DIR
  9. ENV YARN_LOG_DIR=/root/yarn/logs
  10. ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HADOOP_HOME/lib/native
  11. ENV PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin
  12. # install hadoop
  13. RUN mkdir -p /root/hdfs/namenode && \
  14. mkdir -p /root/hdfs/datanode && \
  15. mkdir -p /root/hadoop/tmp && \
  16. mkdir -p /root/hadoop/logs && \
  17. mkdir -p /root/yarn/logs && \
  18. curl -O ${MIRRORS}apache/hadoop/common/hadoop-$HADOOP_VERSION/hadoop-$HADOOP_VERSION.tar.gz && \
  19. tar -xzvf hadoop-$HADOOP_VERSION.tar.gz && \
  20. rm -rf hadoop-$HADOOP_VERSION/share/doc hadoop-$HADOOP_VERSION/share/hadoop/common/jdiff && \
  21. mv hadoop-$HADOOP_VERSION $HADOOP_HOME && \
  22. rm hadoop-$HADOOP_VERSION.tar.gz
  23. COPY hadoop.sh /entrypoint/hadoop.sh
  24. VOLUME ["/usr/local/hadoop/etc/hadoop"]