Dockerfile_aarch64 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  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:xenial
  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. # WARNING: DO NOT PUT JAVA APPS HERE! Otherwise they will install default
  33. # Ubuntu Java. See Java section below!
  34. ######
  35. # hadolint ignore=DL3008
  36. RUN apt-get -q update \
  37. && apt-get -q install -y --no-install-recommends \
  38. apt-utils \
  39. build-essential \
  40. bzip2 \
  41. clang \
  42. curl \
  43. doxygen \
  44. fuse \
  45. g++ \
  46. gcc \
  47. git \
  48. gnupg-agent \
  49. libbz2-dev \
  50. libcurl4-openssl-dev \
  51. libfuse-dev \
  52. libprotobuf-dev \
  53. libprotoc-dev \
  54. libsasl2-dev \
  55. libsnappy-dev \
  56. libssl-dev \
  57. libtool \
  58. libzstd1-dev \
  59. locales \
  60. make \
  61. pinentry-curses \
  62. pkg-config \
  63. python \
  64. python2.7 \
  65. python-pip \
  66. python-pkg-resources \
  67. python-setuptools \
  68. python-wheel \
  69. rsync \
  70. software-properties-common \
  71. snappy \
  72. sudo \
  73. valgrind \
  74. zlib1g-dev \
  75. && apt-get clean \
  76. && rm -rf /var/lib/apt/lists/*
  77. #######
  78. # OpenJDK 8
  79. #######
  80. # hadolint ignore=DL3008
  81. RUN apt-get -q update \
  82. && apt-get -q install -y --no-install-recommends openjdk-8-jdk libbcprov-java \
  83. && apt-get clean \
  84. && rm -rf /var/lib/apt/lists/*
  85. ######
  86. # Install cmake 3.1.0 (3.5.1 ships with Xenial)
  87. # There is no cmake binary available for aarch64. Build from source.
  88. ######
  89. # hadolint ignore=DL3003
  90. RUN mkdir -p /opt/cmake/src \
  91. && curl -L -s -S \
  92. https://cmake.org/files/v3.1/cmake-3.1.0-1-src.tar.bz2 \
  93. -o /opt/cmake/cmake-src.tar.bz2 \
  94. && tar xvjf /opt/cmake/cmake-src.tar.bz2 -C /opt/cmake/src \
  95. && cd /opt/cmake/src \
  96. && tar xvjf cmake-3.1.0.tar.bz2 \
  97. && cd cmake-3.1.0 && patch -p0 -i ../cmake-3.1.0-1.patch && mkdir .build && cd .build \
  98. && ../bootstrap --parallel=2 \
  99. && make -j2 && ./bin/cpack \
  100. && tar xzf cmake-3.1.0-Linux-aarch64.tar.gz --strip-components 1 -C /opt/cmake \
  101. && cd /opt/cmake && rm -rf /opt/cmake/src
  102. ENV CMAKE_HOME /opt/cmake
  103. ENV PATH "${PATH}:/opt/cmake/bin"
  104. ######
  105. # Install Google Protobuf 3.7.1 (2.6.0 ships with Xenial)
  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 install \
  116. && cd /root \
  117. && rm -rf /opt/protobuf-src
  118. ENV PROTOBUF_HOME /opt/protobuf
  119. ENV PATH "${PATH}:/opt/protobuf/bin"
  120. ######
  121. # Install Apache Maven 3.3.9 (3.3.9 ships with Xenial)
  122. ######
  123. # hadolint ignore=DL3008
  124. RUN apt-get -q update \
  125. && apt-get -q install -y --no-install-recommends maven \
  126. && apt-get clean \
  127. && rm -rf /var/lib/apt/lists/*
  128. ENV MAVEN_HOME /usr
  129. ######
  130. # Install findbugs 3.0.1 (3.0.1 ships with Xenial)
  131. # Ant is needed for findbugs
  132. ######
  133. # hadolint ignore=DL3008
  134. RUN apt-get -q update \
  135. && apt-get -q install -y --no-install-recommends findbugs ant \
  136. && apt-get clean \
  137. && rm -rf /var/lib/apt/lists/*
  138. ENV FINDBUGS_HOME /usr
  139. ####
  140. # Install shellcheck (0.4.6, the latest as of 2017-09-26)
  141. ####
  142. # hadolint ignore=DL3008
  143. RUN add-apt-repository -y ppa:hvr/ghc \
  144. && apt-get -q update \
  145. && apt-get -q install -y --no-install-recommends shellcheck \
  146. && apt-get clean \
  147. && rm -rf /var/lib/apt/lists/*
  148. ####
  149. # Install bats (0.4.0, the latest as of 2017-09-26, ships with Xenial)
  150. ####
  151. # hadolint ignore=DL3008
  152. RUN apt-get -q update \
  153. && apt-get -q install -y --no-install-recommends bats \
  154. && apt-get clean \
  155. && rm -rf /var/lib/apt/lists/*
  156. ####
  157. # Install pylint at fixed version (2.0.0 removed python2 support)
  158. # https://github.com/PyCQA/pylint/issues/2294
  159. ####
  160. RUN pip2 install \
  161. configparser==4.0.2 \
  162. pylint==1.9.2
  163. ####
  164. # Install dateutil.parser
  165. ####
  166. RUN pip2 install python-dateutil==2.7.3
  167. ###
  168. # Install node.js 8.17.0 for web UI framework (4.2.6 ships with Xenial)
  169. ###
  170. RUN curl -L -s -S https://deb.nodesource.com/setup_8.x | bash - \
  171. && apt-get install -y --no-install-recommends nodejs=8.17.0-1nodesource1 \
  172. && apt-get clean \
  173. && rm -rf /var/lib/apt/lists/* \
  174. && npm install -g bower@1.8.8
  175. ###
  176. ## Install Yarn 1.12.1 for web UI framework
  177. ####
  178. RUN curl -s -S https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
  179. && echo 'deb https://dl.yarnpkg.com/debian/ stable main' > /etc/apt/sources.list.d/yarn.list \
  180. && apt-get -q update \
  181. && apt-get install -y --no-install-recommends yarn=1.21.1-1 \
  182. && apt-get clean \
  183. && rm -rf /var/lib/apt/lists/*
  184. ###
  185. # Install phantomjs built for aarch64
  186. ####
  187. RUN mkdir -p /opt/phantomjs \
  188. && curl -L -s -S \
  189. https://github.com/liusheng/phantomjs/releases/download/2.1.1/phantomjs-2.1.1-linux-aarch64.tar.bz2 \
  190. -o /opt/phantomjs/phantomjs-2.1.1-linux-aarch64.tar.bz2 \
  191. && tar xvjf /opt/phantomjs/phantomjs-2.1.1-linux-aarch64.tar.bz2 --strip-components 1 -C /opt/phantomjs \
  192. && cp /opt/phantomjs/bin/phantomjs /usr/bin/ \
  193. && rm -rf /opt/phantomjs
  194. ###
  195. # Avoid out of memory errors in builds
  196. ###
  197. ENV MAVEN_OPTS -Xms256m -Xmx1536m
  198. ###
  199. # Everything past this point is either not needed for testing or breaks Yetus.
  200. # So tell Yetus not to read the rest of the file:
  201. # YETUS CUT HERE
  202. ###
  203. # Hugo static website generator (for new hadoop site docs)
  204. RUN curl -L -o hugo.deb https://github.com/gohugoio/hugo/releases/download/v0.58.3/hugo_0.58.3_Linux-ARM64.deb \
  205. && dpkg --install hugo.deb \
  206. && rm hugo.deb
  207. # Add a welcome message and environment checks.
  208. COPY hadoop_env_checks.sh /root/hadoop_env_checks.sh
  209. RUN chmod 755 /root/hadoop_env_checks.sh
  210. # hadolint ignore=SC2016
  211. RUN echo '${HOME}/hadoop_env_checks.sh' >> /root/.bashrc