Dockerfile_aarch64 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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:focal
  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. hugo \
  51. libbcprov-java \
  52. libbz2-dev \
  53. libcurl4-openssl-dev \
  54. libfuse-dev \
  55. libprotobuf-dev \
  56. libprotoc-dev \
  57. libsasl2-dev \
  58. libsnappy-dev \
  59. libssl-dev \
  60. libtool \
  61. libzstd-dev \
  62. locales \
  63. make \
  64. maven \
  65. nodejs \
  66. node-yarn \
  67. npm \
  68. openjdk-11-jdk \
  69. openjdk-8-jdk \
  70. pinentry-curses \
  71. pkg-config \
  72. python \
  73. python2.7 \
  74. python-pkg-resources \
  75. python-setuptools \
  76. rsync \
  77. shellcheck \
  78. software-properties-common \
  79. sudo \
  80. valgrind \
  81. zlib1g-dev \
  82. && apt-get clean \
  83. && rm -rf /var/lib/apt/lists/*
  84. ######
  85. # Set env vars required to build Hadoop
  86. ######
  87. ENV MAVEN_HOME /usr
  88. # JAVA_HOME must be set in Maven >= 3.5.0 (MNG-6003)
  89. ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-arm64
  90. ENV FINDBUGS_HOME /usr
  91. #######
  92. # Install Boost 1.72 (1.71 ships with Focal)
  93. #######
  94. # hadolint ignore=DL3003
  95. RUN mkdir -p /opt/boost-library \
  96. && 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 \
  97. && mv boost_1_72_0.tar.bz2 /opt/boost-library \
  98. && cd /opt/boost-library \
  99. && tar --bzip2 -xf boost_1_72_0.tar.bz2 \
  100. && cd /opt/boost-library/boost_1_72_0 \
  101. && ./bootstrap.sh --prefix=/usr/ \
  102. && ./b2 --without-python install \
  103. && cd /root \
  104. && rm -rf /opt/boost-library
  105. ####
  106. # Install pip (deprecated from Focal toolchain)
  107. ####
  108. # hadolint ignore=DL3003
  109. RUN mkdir -p /opt/pip \
  110. && curl -L https://bootstrap.pypa.io/2.7/get-pip.py > get-pip.py \
  111. && mv get-pip.py /opt/pip \
  112. && cd /opt/pip \
  113. && python2.7 get-pip.py "pip < 21.0" \
  114. && cd /root \
  115. && rm -rf /opt/pip
  116. ######
  117. # Install Google Protobuf 3.7.1 (3.6.1 ships with Focal)
  118. ######
  119. # hadolint ignore=DL3003
  120. RUN mkdir -p /opt/protobuf-src \
  121. && curl -L -s -S \
  122. https://github.com/protocolbuffers/protobuf/releases/download/v3.7.1/protobuf-java-3.7.1.tar.gz \
  123. -o /opt/protobuf.tar.gz \
  124. && tar xzf /opt/protobuf.tar.gz --strip-components 1 -C /opt/protobuf-src \
  125. && cd /opt/protobuf-src \
  126. && ./configure --prefix=/opt/protobuf \
  127. && make "-j$(nproc)" \
  128. && make install \
  129. && cd /root \
  130. && rm -rf /opt/protobuf-src
  131. ENV PROTOBUF_HOME /opt/protobuf
  132. ENV PATH "${PATH}:/opt/protobuf/bin"
  133. ####
  134. # Install pylint at fixed version (2.0.0 removed python2 support)
  135. # https://github.com/PyCQA/pylint/issues/2294
  136. ####
  137. RUN pip2 install \
  138. astroid==1.6.6 \
  139. isort==4.3.21 \
  140. configparser==4.0.2 \
  141. pylint==1.9.2
  142. ####
  143. # Install dateutil.parser
  144. ####
  145. RUN pip2 install python-dateutil==2.7.3
  146. ####
  147. # Install bower
  148. ####
  149. # hadolint ignore=DL3008
  150. RUN npm install -g bower@1.8.8
  151. ###
  152. # Install phantomjs built for aarch64
  153. ####
  154. RUN mkdir -p /opt/phantomjs \
  155. && curl -L -s -S \
  156. https://github.com/liusheng/phantomjs/releases/download/2.1.1/phantomjs-2.1.1-linux-aarch64.tar.bz2 \
  157. -o /opt/phantomjs/phantomjs-2.1.1-linux-aarch64.tar.bz2 \
  158. && tar xvjf /opt/phantomjs/phantomjs-2.1.1-linux-aarch64.tar.bz2 --strip-components 1 -C /opt/phantomjs \
  159. && cp /opt/phantomjs/bin/phantomjs /usr/bin/ \
  160. && rm -rf /opt/phantomjs
  161. ###
  162. # Avoid out of memory errors in builds
  163. ###
  164. ENV MAVEN_OPTS -Xms256m -Xmx1536m
  165. # Skip gpg verification when downloading Yetus via yetus-wrapper
  166. ENV HADOOP_SKIP_YETUS_VERIFICATION true
  167. ###
  168. # Everything past this point is either not needed for testing or breaks Yetus.
  169. # So tell Yetus not to read the rest of the file:
  170. # YETUS CUT HERE
  171. ###
  172. # Add a welcome message and environment checks.
  173. COPY hadoop_env_checks.sh /root/hadoop_env_checks.sh
  174. RUN chmod 755 /root/hadoop_env_checks.sh
  175. # hadolint ignore=SC2016
  176. RUN echo '${HOME}/hadoop_env_checks.sh' >> /root/.bashrc