Dockerfile 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  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:bionic
  19. WORKDIR /root
  20. SHELL ["/bin/bash", "-o", "pipefail", "-c"]
  21. #####
  22. # Disable suggests/recommends
  23. #####
  24. RUN echo APT::Install-Recommends "0"\; > /etc/apt/apt.conf.d/10disableextras
  25. RUN echo APT::Install-Suggests "0"\; >> /etc/apt/apt.conf.d/10disableextras
  26. ENV DEBIAN_FRONTEND noninteractive
  27. ENV DEBCONF_TERSE true
  28. # hadolint ignore=DL3008
  29. RUN apt-get -q update \
  30. && apt-get -q install -y --no-install-recommends \
  31. ant \
  32. apt-utils \
  33. bats \
  34. build-essential \
  35. bzip2 \
  36. clang \
  37. cmake \
  38. curl \
  39. doxygen \
  40. findbugs \
  41. fuse \
  42. g++ \
  43. gcc \
  44. git \
  45. gnupg-agent \
  46. libbcprov-java \
  47. libbz2-dev \
  48. libcurl4-openssl-dev \
  49. libfuse-dev \
  50. libprotobuf-dev \
  51. libprotoc-dev \
  52. libsasl2-dev \
  53. libsnappy-dev \
  54. libssl-dev \
  55. libtool \
  56. libzstd-dev \
  57. locales \
  58. make \
  59. maven \
  60. openjdk-11-jdk \
  61. openjdk-8-jdk \
  62. pinentry-curses \
  63. pkg-config \
  64. python \
  65. python2.7 \
  66. python-pip \
  67. python-pkg-resources \
  68. python-setuptools \
  69. python-wheel \
  70. rsync \
  71. shellcheck \
  72. software-properties-common \
  73. sudo \
  74. valgrind \
  75. zlib1g-dev \
  76. && apt-get clean \
  77. && rm -rf /var/lib/apt/lists/*
  78. ######
  79. # Set env vars required to build Hadoop
  80. ######
  81. ENV MAVEN_HOME /usr
  82. # JAVA_HOME must be set in Maven >= 3.5.0 (MNG-6003)
  83. ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
  84. ENV FINDBUGS_HOME /usr
  85. #######
  86. # Install Boost 1.72 (1.65 ships with Bionic)
  87. #######
  88. # hadolint ignore=DL3003
  89. RUN mkdir -p /opt/boost-library \
  90. && curl -L https://sourceforge.net/projects/boost/files/boost/1.72.0/boost_1_72_0.tar.bz2/download > boost_1_72_0.tar.bz2 \
  91. && mv boost_1_72_0.tar.bz2 /opt/boost-library \
  92. && cd /opt/boost-library \
  93. && tar --bzip2 -xf boost_1_72_0.tar.bz2 \
  94. && cd /opt/boost-library/boost_1_72_0 \
  95. && ./bootstrap.sh --prefix=/usr/ \
  96. && ./b2 --without-python install \
  97. && cd /root \
  98. && rm -rf /opt/boost-library
  99. ######
  100. # Install Google Protobuf 3.7.1 (3.0.0 ships with Bionic)
  101. ######
  102. # hadolint ignore=DL3003
  103. RUN mkdir -p /opt/protobuf-src \
  104. && curl -L -s -S \
  105. https://github.com/protocolbuffers/protobuf/releases/download/v3.7.1/protobuf-java-3.7.1.tar.gz \
  106. -o /opt/protobuf.tar.gz \
  107. && tar xzf /opt/protobuf.tar.gz --strip-components 1 -C /opt/protobuf-src \
  108. && cd /opt/protobuf-src \
  109. && ./configure --prefix=/opt/protobuf \
  110. && make install \
  111. && cd /root \
  112. && rm -rf /opt/protobuf-src
  113. ENV PROTOBUF_HOME /opt/protobuf
  114. ENV PATH "${PATH}:/opt/protobuf/bin"
  115. ####
  116. # Install pylint at fixed version (2.0.0 removed python2 support)
  117. # https://github.com/PyCQA/pylint/issues/2294
  118. ####
  119. RUN pip2 install \
  120. astroid==1.6.6 \
  121. isort==4.3.21 \
  122. configparser==4.0.2 \
  123. pylint==1.9.2
  124. ####
  125. # Install dateutil.parser
  126. ####
  127. RUN pip2 install python-dateutil==2.7.3
  128. ###
  129. # Install node.js 10.x for web UI framework (4.2.6 ships with Xenial)
  130. ###
  131. # hadolint ignore=DL3008
  132. RUN curl -L -s -S https://deb.nodesource.com/setup_10.x | bash - \
  133. && apt-get install -y --no-install-recommends nodejs \
  134. && apt-get clean \
  135. && rm -rf /var/lib/apt/lists/* \
  136. && npm install -g bower@1.8.8
  137. ###
  138. ## Install Yarn 1.12.1 for web UI framework
  139. ####
  140. RUN curl -s -S https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
  141. && echo 'deb https://dl.yarnpkg.com/debian/ stable main' > /etc/apt/sources.list.d/yarn.list \
  142. && apt-get -q update \
  143. && apt-get install -y --no-install-recommends yarn=1.21.1-1 \
  144. && apt-get clean \
  145. && rm -rf /var/lib/apt/lists/*
  146. ###
  147. # Install hadolint
  148. ####
  149. RUN curl -L -s -S \
  150. https://github.com/hadolint/hadolint/releases/download/v1.11.1/hadolint-Linux-x86_64 \
  151. -o /bin/hadolint \
  152. && chmod a+rx /bin/hadolint \
  153. && shasum -a 512 /bin/hadolint | \
  154. awk '$1!="734e37c1f6619cbbd86b9b249e69c9af8ee1ea87a2b1ff71dccda412e9dac35e63425225a95d71572091a3f0a11e9a04c2fc25d9e91b840530c26af32b9891ca" {exit(1)}'
  155. ###
  156. # Avoid out of memory errors in builds
  157. ###
  158. ENV MAVEN_OPTS -Xms256m -Xmx1536m
  159. # Skip gpg verification when downloading Yetus via yetus-wrapper
  160. ENV HADOOP_SKIP_YETUS_VERIFICATION true
  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. # Hugo static website generator for new hadoop site
  167. RUN curl -L -o hugo.deb https://github.com/gohugoio/hugo/releases/download/v0.58.3/hugo_0.58.3_Linux-64bit.deb \
  168. && dpkg --install hugo.deb \
  169. && rm hugo.deb
  170. # Add a welcome message and environment checks.
  171. COPY hadoop_env_checks.sh /root/hadoop_env_checks.sh
  172. RUN chmod 755 /root/hadoop_env_checks.sh
  173. # hadolint ignore=SC2016
  174. RUN echo '${HOME}/hadoop_env_checks.sh' >> /root/.bashrc