Dockerfile_aarch64 5.9 KB

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