Dockerfile 5.8 KB

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