Dockerfile 5.7 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:bionic
  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. bats \
  40. build-essential \
  41. bzip2 \
  42. clang \
  43. cmake \
  44. curl \
  45. doxygen \
  46. fuse \
  47. g++ \
  48. gcc \
  49. git \
  50. gnupg-agent \
  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. libsnappy-dev \
  60. libtool \
  61. libzstd1-dev \
  62. locales \
  63. make \
  64. pinentry-curses \
  65. pkg-config \
  66. python3 \
  67. python3-pip \
  68. python3-pkg-resources \
  69. python3-setuptools \
  70. python3-wheel \
  71. rsync \
  72. shellcheck \
  73. software-properties-common \
  74. sudo \
  75. valgrind \
  76. zlib1g-dev \
  77. && apt-get clean \
  78. && rm -rf /var/lib/apt/lists/*
  79. #######
  80. # OpenJDK 8
  81. #######
  82. # hadolint ignore=DL3008
  83. RUN apt-get -q update \
  84. && apt-get -q install -y --no-install-recommends openjdk-8-jdk libbcprov-java \
  85. && apt-get clean \
  86. && rm -rf /var/lib/apt/lists/*
  87. ######
  88. # Install Google Protobuf 3.7.1 (3.0.0 ships with Bionic)
  89. ######
  90. # hadolint ignore=DL3003
  91. RUN mkdir -p /opt/protobuf-src \
  92. && curl -L -s -S \
  93. https://github.com/protocolbuffers/protobuf/releases/download/v3.7.1/protobuf-java-3.7.1.tar.gz \
  94. -o /opt/protobuf.tar.gz \
  95. && tar xzf /opt/protobuf.tar.gz --strip-components 1 -C /opt/protobuf-src \
  96. && cd /opt/protobuf-src \
  97. && ./configure --prefix=/opt/protobuf \
  98. && make install \
  99. && cd /root \
  100. && rm -rf /opt/protobuf-src
  101. ENV PROTOBUF_HOME /opt/protobuf
  102. ENV PATH "${PATH}:/opt/protobuf/bin"
  103. ######
  104. # Install Apache Maven 3.6.0 (3.6.0 ships with Bionic)
  105. ######
  106. # hadolint ignore=DL3008
  107. RUN apt-get -q update \
  108. && apt-get -q install -y --no-install-recommends maven \
  109. && apt-get clean \
  110. && rm -rf /var/lib/apt/lists/*
  111. ENV MAVEN_HOME /usr
  112. # JAVA_HOME must be set in Maven >= 3.5.0 (MNG-6003)
  113. ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
  114. ######
  115. # Install findbugs 3.1.0 (3.1.0 ships with Bionic)
  116. # Ant is needed for findbugs
  117. ######
  118. # hadolint ignore=DL3008
  119. RUN apt-get -q update \
  120. && apt-get -q install -y --no-install-recommends findbugs ant \
  121. && apt-get clean \
  122. && rm -rf /var/lib/apt/lists/*
  123. ENV FINDBUGS_HOME /usr
  124. # Install pylint and python-dateutil
  125. RUN pip3 install pylint==2.6.0 python-dateutil==2.8.1
  126. ###
  127. # Install node.js 10.x for web UI framework (4.2.6 ships with Xenial)
  128. ###
  129. # hadolint ignore=DL3008
  130. RUN curl -L -s -S https://deb.nodesource.com/setup_10.x | bash - \
  131. && apt-get install -y --no-install-recommends nodejs \
  132. && apt-get clean \
  133. && rm -rf /var/lib/apt/lists/* \
  134. && npm install -g bower@1.8.8
  135. ###
  136. ## Install Yarn 1.22.5 for web UI framework
  137. ####
  138. RUN curl -s -S https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
  139. && echo 'deb https://dl.yarnpkg.com/debian/ stable main' > /etc/apt/sources.list.d/yarn.list \
  140. && apt-get -q update \
  141. && apt-get install -y --no-install-recommends yarn=1.22.5-1 \
  142. && apt-get clean \
  143. && rm -rf /var/lib/apt/lists/*
  144. ###
  145. # Install hadolint
  146. ####
  147. RUN curl -L -s -S \
  148. https://github.com/hadolint/hadolint/releases/download/v1.11.1/hadolint-Linux-x86_64 \
  149. -o /bin/hadolint \
  150. && chmod a+rx /bin/hadolint \
  151. && shasum -a 512 /bin/hadolint | \
  152. awk '$1!="734e37c1f6619cbbd86b9b249e69c9af8ee1ea87a2b1ff71dccda412e9dac35e63425225a95d71572091a3f0a11e9a04c2fc25d9e91b840530c26af32b9891ca" {exit(1)}'
  153. ###
  154. # Avoid out of memory errors in builds
  155. ###
  156. ENV MAVEN_OPTS -Xms256m -Xmx1536m
  157. # Skip gpg verification when downloading Yetus via yetus-wrapper
  158. ENV HADOOP_SKIP_YETUS_VERIFICATION true
  159. ###
  160. # Everything past this point is either not needed for testing or breaks Yetus.
  161. # So tell Yetus not to read the rest of the file:
  162. # YETUS CUT HERE
  163. ###
  164. # Hugo static website generator for new hadoop site
  165. RUN curl -L -o hugo.deb https://github.com/gohugoio/hugo/releases/download/v0.58.3/hugo_0.58.3_Linux-64bit.deb \
  166. && dpkg --install hugo.deb \
  167. && rm hugo.deb
  168. # Add a welcome message and environment checks.
  169. COPY hadoop_env_checks.sh /root/hadoop_env_checks.sh
  170. RUN chmod 755 /root/hadoop_env_checks.sh
  171. # hadolint ignore=SC2016
  172. RUN echo '${HOME}/hadoop_env_checks.sh' >> /root/.bashrc