Dockerfile_aarch64 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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. fuse \
  45. g++ \
  46. gcc \
  47. git \
  48. gnupg-agent \
  49. hugo \
  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. nodejs \
  65. node-yarn \
  66. npm \
  67. openjdk-11-jdk \
  68. openjdk-8-jdk \
  69. pinentry-curses \
  70. pkg-config \
  71. python3 \
  72. python3-pip \
  73. python3-pkg-resources \
  74. python3-setuptools \
  75. python3-wheel \
  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. #######
  91. # Install SpotBugs 4.2.2
  92. #######
  93. RUN mkdir -p /opt/spotbugs \
  94. && curl -L -s -S https://github.com/spotbugs/spotbugs/releases/download/4.2.2/spotbugs-4.2.2.tgz \
  95. -o /opt/spotbugs.tgz \
  96. && tar xzf /opt/spotbugs.tgz --strip-components 1 -C /opt/spotbugs \
  97. && chmod +x /opt/spotbugs/bin/*
  98. ENV SPOTBUGS_HOME /opt/spotbugs
  99. #######
  100. # Install Boost 1.72 (1.71 ships with Focal)
  101. #######
  102. # hadolint ignore=DL3003
  103. RUN mkdir -p /opt/boost-library \
  104. && 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 \
  105. && mv boost_1_72_0.tar.bz2 /opt/boost-library \
  106. && cd /opt/boost-library \
  107. && tar --bzip2 -xf boost_1_72_0.tar.bz2 \
  108. && cd /opt/boost-library/boost_1_72_0 \
  109. && ./bootstrap.sh --prefix=/usr/ \
  110. && ./b2 --without-python install \
  111. && cd /root \
  112. && rm -rf /opt/boost-library
  113. ######
  114. # Install Google Protobuf 3.7.1 (3.6.1 ships with Focal)
  115. ######
  116. # hadolint ignore=DL3003
  117. RUN mkdir -p /opt/protobuf-src \
  118. && curl -L -s -S \
  119. https://github.com/protocolbuffers/protobuf/releases/download/v3.7.1/protobuf-java-3.7.1.tar.gz \
  120. -o /opt/protobuf.tar.gz \
  121. && tar xzf /opt/protobuf.tar.gz --strip-components 1 -C /opt/protobuf-src \
  122. && cd /opt/protobuf-src \
  123. && ./configure --prefix=/opt/protobuf \
  124. && make "-j$(nproc)" \
  125. && make install \
  126. && cd /root \
  127. && rm -rf /opt/protobuf-src
  128. ENV PROTOBUF_HOME /opt/protobuf
  129. ENV PATH "${PATH}:/opt/protobuf/bin"
  130. ####
  131. # Install pylint and python-dateutil
  132. ####
  133. RUN pip3 install pylint==2.6.0 python-dateutil==2.8.1
  134. ####
  135. # Install bower
  136. ####
  137. # hadolint ignore=DL3008
  138. RUN npm install -g bower@1.8.8
  139. ###
  140. # Install phantomjs built for aarch64
  141. ####
  142. RUN mkdir -p /opt/phantomjs \
  143. && curl -L -s -S \
  144. https://github.com/liusheng/phantomjs/releases/download/2.1.1/phantomjs-2.1.1-linux-aarch64.tar.bz2 \
  145. -o /opt/phantomjs/phantomjs-2.1.1-linux-aarch64.tar.bz2 \
  146. && tar xvjf /opt/phantomjs/phantomjs-2.1.1-linux-aarch64.tar.bz2 --strip-components 1 -C /opt/phantomjs \
  147. && cp /opt/phantomjs/bin/phantomjs /usr/bin/ \
  148. && rm -rf /opt/phantomjs
  149. ###
  150. # Avoid out of memory errors in builds
  151. ###
  152. ENV MAVEN_OPTS -Xms256m -Xmx1536m
  153. # Skip gpg verification when downloading Yetus via yetus-wrapper
  154. ENV HADOOP_SKIP_YETUS_VERIFICATION true
  155. ###
  156. # Everything past this point is either not needed for testing or breaks Yetus.
  157. # So tell Yetus not to read the rest of the file:
  158. # YETUS CUT HERE
  159. ###
  160. # Add a welcome message and environment checks.
  161. COPY hadoop_env_checks.sh /root/hadoop_env_checks.sh
  162. RUN chmod 755 /root/hadoop_env_checks.sh
  163. # hadolint ignore=SC2016
  164. RUN echo '${HOME}/hadoop_env_checks.sh' >> /root/.bashrc