Dockerfile 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  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. locales \
  54. make \
  55. pinentry-curses \
  56. pkg-config \
  57. python \
  58. python2.7 \
  59. python-pip \
  60. python-pkg-resources \
  61. python-setuptools \
  62. python-wheel \
  63. rsync \
  64. software-properties-common \
  65. snappy \
  66. sudo \
  67. zlib1g-dev
  68. #######
  69. # OpenJDK 8
  70. #######
  71. RUN apt-get -q install -y openjdk-8-jdk
  72. #######
  73. # OpenJDK 9
  74. # w/workaround for
  75. # https://bugs.launchpad.net/ubuntu/+source/openjdk-9/+bug/1593191
  76. #######
  77. RUN apt-get -o Dpkg::Options::="--force-overwrite" \
  78. -q install -y \
  79. openjdk-9-jdk-headless
  80. #######
  81. # Set default Java
  82. #######
  83. #
  84. # By default, OpenJDK sets the default Java to the highest version.
  85. # We want the opposite, soooooo....
  86. #
  87. RUN update-java-alternatives --set java-1.8.0-openjdk-amd64
  88. RUN update-alternatives --get-selections | grep -i jdk | \
  89. while read line; do \
  90. alternative=$(echo $line | awk '{print $1}'); \
  91. path=$(echo $line | awk '{print $3}'); \
  92. newpath=$(echo $path | sed -e 's/java-9/java-8/'); \
  93. update-alternatives --set $alternative $newpath; \
  94. done
  95. ######
  96. # Install cmake 3.1.0 (3.5.1 ships with Xenial)
  97. ######
  98. RUN mkdir -p /opt/cmake && \
  99. curl -L -s -S \
  100. https://cmake.org/files/v3.1/cmake-3.1.0-Linux-x86_64.tar.gz \
  101. -o /opt/cmake.tar.gz && \
  102. tar xzf /opt/cmake.tar.gz --strip-components 1 -C /opt/cmake
  103. ENV CMAKE_HOME /opt/cmake
  104. ENV PATH "${PATH}:/opt/cmake/bin"
  105. ######
  106. # Install Google Protobuf 2.5.0 (2.6.0 ships with Xenial)
  107. ######
  108. RUN mkdir -p /opt/protobuf-src && \
  109. curl -L -s -S \
  110. https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz \
  111. -o /opt/protobuf.tar.gz && \
  112. tar xzf /opt/protobuf.tar.gz --strip-components 1 -C /opt/protobuf-src
  113. RUN cd /opt/protobuf-src && ./configure --prefix=/opt/protobuf && make install
  114. ENV PROTOBUF_HOME /opt/protobuf
  115. ENV PATH "${PATH}:/opt/protobuf/bin"
  116. ######
  117. # Install Apache Maven 3.3.9 (3.3.9 ships with Xenial)
  118. ######
  119. RUN apt-get -q update && apt-get -q install -y maven
  120. ENV MAVEN_HOME /usr
  121. ######
  122. # Install findbugs 3.0.1 (3.0.1 ships with Xenial)
  123. # Ant is needed for findbugs
  124. ######
  125. RUN apt-get -q update && apt-get -q install -y findbugs ant
  126. ENV FINDBUGS_HOME /usr
  127. ####
  128. # Install shellcheck (0.4.6, the latest as of 2017-09-26)
  129. ####
  130. RUN add-apt-repository -y ppa:jonathonf/ghc-8.0.2
  131. RUN apt-get -q update && apt-get -q install -y shellcheck
  132. ####
  133. # Install bats (0.4.0, the latest as of 2017-09-26, ships with Xenial)
  134. ####
  135. RUN apt-get -q update && apt-get -q install -y bats
  136. ####
  137. # Install pylint (always want latest)
  138. ####
  139. RUN pip2 install pylint
  140. ####
  141. # Install dateutil.parser
  142. ####
  143. RUN pip2 install python-dateutil
  144. ###
  145. # Install node.js for web UI framework (4.2.6 ships with Xenial)
  146. ###
  147. RUN apt-get -y install nodejs && \
  148. ln -s /usr/bin/nodejs /usr/bin/node && \
  149. apt-get -y install npm && \
  150. npm install npm@latest -g && \
  151. npm install -g bower && \
  152. npm install -g ember-cli
  153. ###
  154. # Avoid out of memory errors in builds
  155. ###
  156. ENV MAVEN_OPTS -Xms256m -Xmx1g
  157. ###
  158. # Everything past this point is either not needed for testing or breaks Yetus.
  159. # So tell Yetus not to read the rest of the file:
  160. # YETUS CUT HERE
  161. ###
  162. ####
  163. # Install svn & Forrest (for Apache Hadoop website)
  164. ###
  165. RUN apt-get -q update && apt-get -q install -y subversion
  166. RUN mkdir -p /opt/apache-forrest && \
  167. curl -L -s -S \
  168. https://archive.apache.org/dist/forrest/0.8/apache-forrest-0.8.tar.gz \
  169. -o /opt/forrest.tar.gz && \
  170. tar xzf /opt/forrest.tar.gz --strip-components 1 -C /opt/apache-forrest
  171. RUN echo 'forrest.home=/opt/apache-forrest' > build.properties
  172. ENV FORREST_HOME=/opt/apache-forrest
  173. # Add a welcome message and environment checks.
  174. ADD hadoop_env_checks.sh /root/hadoop_env_checks.sh
  175. RUN chmod 755 /root/hadoop_env_checks.sh
  176. RUN echo '~/hadoop_env_checks.sh' >> /root/.bashrc