Dockerfile 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. # Licensed to the Apache Software Foundation (ASF) under one
  2. # or more contributor license agreements. See the NOTICE file
  3. # distributed with this work for additional information
  4. # regarding copyright ownership. The ASF licenses this file
  5. # to you under the Apache License, Version 2.0 (the
  6. # "License"); you may not use this file except in compliance
  7. # with the License. You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. # Dockerfile for installing the necessary dependencies for building Hadoop.
  17. # See BUILDING.txt.
  18. FROM ubuntu:xenial
  19. WORKDIR /root
  20. #####
  21. # Disable suggests/recommends
  22. #####
  23. RUN echo APT::Install-Recommends "0"\; > /etc/apt/apt.conf.d/10disableextras
  24. RUN echo APT::Install-Suggests "0"\; >> /etc/apt/apt.conf.d/10disableextras
  25. ENV DEBIAN_FRONTEND noninteractive
  26. ENV DEBCONF_TERSE true
  27. ######
  28. # Install common dependencies from packages. Versions here are either
  29. # sufficient or irrelevant.
  30. #
  31. # WARNING: DO NOT PUT JAVA APPS HERE! Otherwise they will install default
  32. # Ubuntu Java. See Java section below!
  33. ######
  34. RUN apt-get -q update && apt-get -q install -y \
  35. apt-utils \
  36. build-essential \
  37. bzip2 \
  38. curl \
  39. doxygen \
  40. fuse \
  41. g++ \
  42. gcc \
  43. git \
  44. gnupg-agent \
  45. libbz2-dev \
  46. libcurl4-openssl-dev \
  47. libfuse-dev \
  48. libprotobuf-dev \
  49. libprotoc-dev \
  50. libsnappy-dev \
  51. libssl-dev \
  52. libtool \
  53. libzstd1-dev \
  54. locales \
  55. make \
  56. pinentry-curses \
  57. pkg-config \
  58. python \
  59. python2.7 \
  60. python-pip \
  61. python-pkg-resources \
  62. python-setuptools \
  63. python-wheel \
  64. rsync \
  65. software-properties-common \
  66. snappy \
  67. sudo \
  68. zlib1g-dev
  69. #######
  70. # OpenJDK 8
  71. #######
  72. RUN apt-get -q install -y openjdk-8-jdk
  73. #######
  74. # OpenJDK 9
  75. # w/workaround for
  76. # https://bugs.launchpad.net/ubuntu/+source/openjdk-9/+bug/1593191
  77. #######
  78. RUN apt-get -o Dpkg::Options::="--force-overwrite" \
  79. -q install -y \
  80. openjdk-9-jdk-headless
  81. #######
  82. # Set default Java
  83. #######
  84. #
  85. # By default, OpenJDK sets the default Java to the highest version.
  86. # We want the opposite, soooooo....
  87. #
  88. RUN update-java-alternatives --set java-1.8.0-openjdk-amd64
  89. RUN update-alternatives --get-selections | grep -i jdk | \
  90. while read line; do \
  91. alternative=$(echo $line | awk '{print $1}'); \
  92. path=$(echo $line | awk '{print $3}'); \
  93. newpath=$(echo $path | sed -e 's/java-9/java-8/'); \
  94. update-alternatives --set $alternative $newpath; \
  95. done
  96. ######
  97. # Install cmake 3.1.0 (3.5.1 ships with Xenial)
  98. ######
  99. RUN mkdir -p /opt/cmake && \
  100. curl -L -s -S \
  101. https://cmake.org/files/v3.1/cmake-3.1.0-Linux-x86_64.tar.gz \
  102. -o /opt/cmake.tar.gz && \
  103. tar xzf /opt/cmake.tar.gz --strip-components 1 -C /opt/cmake
  104. ENV CMAKE_HOME /opt/cmake
  105. ENV PATH "${PATH}:/opt/cmake/bin"
  106. ######
  107. # Install Google Protobuf 2.5.0 (2.6.0 ships with Xenial)
  108. ######
  109. RUN mkdir -p /opt/protobuf-src && \
  110. curl -L -s -S \
  111. https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz \
  112. -o /opt/protobuf.tar.gz && \
  113. tar xzf /opt/protobuf.tar.gz --strip-components 1 -C /opt/protobuf-src
  114. RUN cd /opt/protobuf-src && ./configure --prefix=/opt/protobuf && make install
  115. ENV PROTOBUF_HOME /opt/protobuf
  116. ENV PATH "${PATH}:/opt/protobuf/bin"
  117. ######
  118. # Install Apache Maven 3.3.9 (3.3.9 ships with Xenial)
  119. ######
  120. RUN apt-get -q update && apt-get -q install -y maven
  121. ENV MAVEN_HOME /usr
  122. ######
  123. # Install findbugs 3.0.1 (3.0.1 ships with Xenial)
  124. # Ant is needed for findbugs
  125. ######
  126. RUN apt-get -q update && apt-get -q install -y findbugs ant
  127. ENV FINDBUGS_HOME /usr
  128. ####
  129. # Install shellcheck (0.4.6, the latest as of 2017-09-26)
  130. ####
  131. RUN add-apt-repository -y ppa:jonathonf/ghc-8.0.2
  132. RUN apt-get -q update && apt-get -q install -y shellcheck
  133. ####
  134. # Install bats (0.4.0, the latest as of 2017-09-26, ships with Xenial)
  135. ####
  136. RUN apt-get -q update && apt-get -q install -y bats
  137. ####
  138. # Install pylint at fixed version (2.0.0 removed python2 support)
  139. # https://github.com/PyCQA/pylint/issues/2294
  140. ####
  141. RUN pip2 install pylint==1.9.2
  142. ####
  143. # Install dateutil.parser
  144. ####
  145. RUN pip2 install python-dateutil
  146. ###
  147. # Install node.js for web UI framework (4.2.6 ships with Xenial)
  148. ###
  149. RUN apt-get -y install nodejs && \
  150. ln -s /usr/bin/nodejs /usr/bin/node && \
  151. apt-get -y install npm && \
  152. npm install npm@latest -g && \
  153. npm install -g bower && \
  154. npm install -g ember-cli
  155. ###
  156. # Avoid out of memory errors in builds
  157. ###
  158. ENV MAVEN_OPTS -Xms256m -Xmx1536m
  159. ###
  160. # Everything past this point is either not needed for testing or breaks Yetus.
  161. # So tell Yetus not to read the rest of the file:
  162. # YETUS CUT HERE
  163. ###
  164. ####
  165. # Install svn & Forrest (for Apache Hadoop website)
  166. ###
  167. RUN apt-get -q update && apt-get -q install -y subversion
  168. RUN mkdir -p /opt/apache-forrest && \
  169. curl -L -s -S \
  170. https://archive.apache.org/dist/forrest/0.8/apache-forrest-0.8.tar.gz \
  171. -o /opt/forrest.tar.gz && \
  172. tar xzf /opt/forrest.tar.gz --strip-components 1 -C /opt/apache-forrest
  173. RUN echo 'forrest.home=/opt/apache-forrest' > build.properties
  174. ENV FORREST_HOME=/opt/apache-forrest
  175. # Add a welcome message and environment checks.
  176. ADD hadoop_env_checks.sh /root/hadoop_env_checks.sh
  177. RUN chmod 755 /root/hadoop_env_checks.sh
  178. RUN echo '~/hadoop_env_checks.sh' >> /root/.bashrc