Dockerfile_aarch64 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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 Google Protobuf 3.7.1 (3.6.1 ships with Focal)
  106. ######
  107. # hadolint ignore=DL3003
  108. RUN mkdir -p /opt/protobuf-src \
  109. && curl -L -s -S \
  110. https://github.com/protocolbuffers/protobuf/releases/download/v3.7.1/protobuf-java-3.7.1.tar.gz \
  111. -o /opt/protobuf.tar.gz \
  112. && tar xzf /opt/protobuf.tar.gz --strip-components 1 -C /opt/protobuf-src \
  113. && cd /opt/protobuf-src \
  114. && ./configure --prefix=/opt/protobuf \
  115. && make "-j$(nproc)" \
  116. && make install \
  117. && cd /root \
  118. && rm -rf /opt/protobuf-src
  119. ENV PROTOBUF_HOME /opt/protobuf
  120. ENV PATH "${PATH}:/opt/protobuf/bin"
  121. ####
  122. # Install pylint and python-dateutil
  123. ####
  124. RUN pip3 install pylint==2.6.0 python-dateutil==2.8.1
  125. ####
  126. # Install bower
  127. ####
  128. # hadolint ignore=DL3008
  129. RUN npm install -g bower@1.8.8
  130. ###
  131. # Avoid out of memory errors in builds
  132. ###
  133. ENV MAVEN_OPTS -Xms256m -Xmx3072m
  134. # Skip gpg verification when downloading Yetus via yetus-wrapper
  135. ENV HADOOP_SKIP_YETUS_VERIFICATION true
  136. # Force PhantomJS to be in 'headless' mode, do not connect to Xwindow
  137. ENV QT_QPA_PLATFORM offscreen
  138. ###
  139. # Everything past this point is either not needed for testing or breaks Yetus.
  140. # So tell Yetus not to read the rest of the file:
  141. # YETUS CUT HERE
  142. ###
  143. # Add a welcome message and environment checks.
  144. COPY hadoop_env_checks.sh /root/hadoop_env_checks.sh
  145. RUN chmod 755 /root/hadoop_env_checks.sh
  146. # hadolint ignore=SC2016
  147. RUN echo '${HOME}/hadoop_env_checks.sh' >> /root/.bashrc