Dockerfile_aarch64 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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. phantomjs \
  70. pinentry-curses \
  71. pkg-config \
  72. python2.7 \
  73. python3 \
  74. python3-pip \
  75. python3-pkg-resources \
  76. python3-setuptools \
  77. python3-wheel \
  78. rsync \
  79. shellcheck \
  80. software-properties-common \
  81. sudo \
  82. valgrind \
  83. zlib1g-dev \
  84. && apt-get clean \
  85. && rm -rf /var/lib/apt/lists/*
  86. RUN locale-gen en_US.UTF-8
  87. ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
  88. ENV PYTHONIOENCODING=utf-8
  89. ######
  90. # Set env vars required to build Hadoop
  91. ######
  92. ENV MAVEN_HOME /usr
  93. # JAVA_HOME must be set in Maven >= 3.5.0 (MNG-6003)
  94. ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-arm64
  95. #######
  96. # Install SpotBugs 4.2.2
  97. #######
  98. RUN mkdir -p /opt/spotbugs \
  99. && curl -L -s -S https://github.com/spotbugs/spotbugs/releases/download/4.2.2/spotbugs-4.2.2.tgz \
  100. -o /opt/spotbugs.tgz \
  101. && tar xzf /opt/spotbugs.tgz --strip-components 1 -C /opt/spotbugs \
  102. && chmod +x /opt/spotbugs/bin/*
  103. ENV SPOTBUGS_HOME /opt/spotbugs
  104. #######
  105. # Install Boost 1.72 (1.71 ships with Focal)
  106. #######
  107. # hadolint ignore=DL3003
  108. RUN mkdir -p /opt/boost-library \
  109. && 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 \
  110. && mv boost_1_72_0.tar.bz2 /opt/boost-library \
  111. && cd /opt/boost-library \
  112. && tar --bzip2 -xf boost_1_72_0.tar.bz2 \
  113. && cd /opt/boost-library/boost_1_72_0 \
  114. && ./bootstrap.sh --prefix=/usr/ \
  115. && ./b2 --without-python install \
  116. && cd /root \
  117. && rm -rf /opt/boost-library
  118. ######
  119. # Install Google Protobuf 3.7.1 (3.6.1 ships with Focal)
  120. ######
  121. # hadolint ignore=DL3003
  122. RUN mkdir -p /opt/protobuf-src \
  123. && curl -L -s -S \
  124. https://github.com/protocolbuffers/protobuf/releases/download/v3.7.1/protobuf-java-3.7.1.tar.gz \
  125. -o /opt/protobuf.tar.gz \
  126. && tar xzf /opt/protobuf.tar.gz --strip-components 1 -C /opt/protobuf-src \
  127. && cd /opt/protobuf-src \
  128. && ./configure --prefix=/opt/protobuf \
  129. && make "-j$(nproc)" \
  130. && make install \
  131. && cd /root \
  132. && rm -rf /opt/protobuf-src
  133. ENV PROTOBUF_HOME /opt/protobuf
  134. ENV PATH "${PATH}:/opt/protobuf/bin"
  135. ####
  136. # Install pylint and python-dateutil
  137. ####
  138. RUN pip3 install pylint==2.6.0 python-dateutil==2.8.1
  139. ####
  140. # Install bower
  141. ####
  142. # hadolint ignore=DL3008
  143. RUN npm install -g bower@1.8.8
  144. ###
  145. # Avoid out of memory errors in builds
  146. ###
  147. ENV MAVEN_OPTS -Xms256m -Xmx1536m
  148. # Skip gpg verification when downloading Yetus via yetus-wrapper
  149. ENV HADOOP_SKIP_YETUS_VERIFICATION true
  150. # Force PhantomJS to be in 'headless' mode, do not connect to Xwindow
  151. ENV QT_QPA_PLATFORM offscreen
  152. ###
  153. # Everything past this point is either not needed for testing or breaks Yetus.
  154. # So tell Yetus not to read the rest of the file:
  155. # YETUS CUT HERE
  156. ###
  157. # Add a welcome message and environment checks.
  158. COPY hadoop_env_checks.sh /root/hadoop_env_checks.sh
  159. RUN chmod 755 /root/hadoop_env_checks.sh
  160. # hadolint ignore=SC2016
  161. RUN echo '${HOME}/hadoop_env_checks.sh' >> /root/.bashrc