Dockerfile 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  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. curl \
  42. doxygen \
  43. fuse \
  44. g++ \
  45. gcc \
  46. git \
  47. gnupg-agent \
  48. libbz2-dev \
  49. libcurl4-openssl-dev \
  50. libfuse-dev \
  51. libprotobuf-dev \
  52. libprotoc-dev \
  53. libsasl2-dev \
  54. libsnappy-dev \
  55. libssl-dev \
  56. libtool \
  57. libzstd1-dev \
  58. locales \
  59. make \
  60. pinentry-curses \
  61. pkg-config \
  62. python \
  63. python2.7 \
  64. python-pip \
  65. python-pkg-resources \
  66. python-setuptools \
  67. python-wheel \
  68. rsync \
  69. software-properties-common \
  70. snappy \
  71. sudo \
  72. zlib1g-dev \
  73. && apt-get clean \
  74. && rm -rf /var/lib/apt/lists/*
  75. #######
  76. # OpenJDK 8
  77. #######
  78. # hadolint ignore=DL3008
  79. RUN apt-get -q update \
  80. && apt-get -q install -y --no-install-recommends openjdk-8-jdk \
  81. && apt-get clean \
  82. && rm -rf /var/lib/apt/lists/*
  83. #######
  84. # OpenJDK 7
  85. #######
  86. RUN curl -L -s -S https://cdn.azul.com/zulu/bin/zulu7.38.0.11-ca-jdk7.0.262-linux_amd64.deb \
  87. -o /opt/jdk7.deb \
  88. && apt-get -q install -y --no-install-recommends /opt/jdk7.deb \
  89. && rm -rf /opt/jdk7.deb \
  90. && apt-get clean \
  91. && rm -rf /var/lib/apt/lists/*
  92. ######
  93. # Install cmake 3.1.0 (3.5.1 ships with Xenial)
  94. ######
  95. RUN mkdir -p /opt/cmake \
  96. && curl -L -s -S \
  97. https://cmake.org/files/v3.1/cmake-3.1.0-Linux-x86_64.tar.gz \
  98. -o /opt/cmake.tar.gz \
  99. && tar xzf /opt/cmake.tar.gz --strip-components 1 -C /opt/cmake
  100. ENV CMAKE_HOME /opt/cmake
  101. ENV PATH "${PATH}:/opt/cmake/bin"
  102. ######
  103. # Install Google Protobuf 2.5.0 (2.6.0 ships with Xenial)
  104. ######
  105. # hadolint ignore=DL3003
  106. RUN mkdir -p /opt/protobuf-src \
  107. && curl -L -s -S \
  108. https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz \
  109. -o /opt/protobuf.tar.gz \
  110. && tar xzf /opt/protobuf.tar.gz --strip-components 1 -C /opt/protobuf-src \
  111. && cd /opt/protobuf-src \
  112. && ./configure --prefix=/opt/protobuf \
  113. && make install \
  114. && cd /root \
  115. && rm -rf /opt/protobuf-src
  116. ENV PROTOBUF_HOME /opt/protobuf
  117. ENV PATH "${PATH}:/opt/protobuf/bin"
  118. ######
  119. # Install Apache Maven 3.3.9 (3.3.9 ships with Xenial)
  120. ######
  121. # hadolint ignore=DL3008
  122. RUN apt-get -q update \
  123. && apt-get -q install -y --no-install-recommends maven \
  124. && apt-get clean \
  125. && rm -rf /var/lib/apt/lists/*
  126. ENV MAVEN_HOME /usr
  127. ######
  128. # Install Apache Ant 1.9.6 (1.9.6 ships with Xenial)
  129. ######
  130. # hadolint ignore=DL3008
  131. RUN apt-get -q update \
  132. && apt-get -q install -y --no-install-recommends ant \
  133. && apt-get clean \
  134. && rm -rf /var/lib/apt/lists/*
  135. #######
  136. # Install SpotBugs 4.2.2
  137. #######
  138. RUN mkdir -p /opt/spotbugs \
  139. && curl -L -s -S https://github.com/spotbugs/spotbugs/releases/download/4.2.2/spotbugs-4.2.2.tgz \
  140. -o /opt/spotbugs.tgz \
  141. && tar xzf /opt/spotbugs.tgz --strip-components 1 -C /opt/spotbugs \
  142. && chmod +x /opt/spotbugs/bin/*
  143. ENV SPOTBUGS_HOME /opt/spotbugs
  144. ####
  145. # Install shellcheck (0.4.6, the latest as of 2017-09-26)
  146. ####
  147. # hadolint ignore=DL3008
  148. RUN add-apt-repository -y ppa:hvr/ghc \
  149. && apt-get -q update \
  150. && apt-get -q install -y --no-install-recommends shellcheck ghc-8.0.2 \
  151. && apt-get clean \
  152. && rm -rf /var/lib/apt/lists/*
  153. ####
  154. # Install bats (0.4.0, the latest as of 2017-09-26, ships with Xenial)
  155. ####
  156. # hadolint ignore=DL3008
  157. RUN apt-get -q update \
  158. && apt-get -q install -y --no-install-recommends bats \
  159. && apt-get clean \
  160. && rm -rf /var/lib/apt/lists/*
  161. ####
  162. # Install pylint at fixed version (2.0.0 removed python2 support)
  163. # https://github.com/PyCQA/pylint/issues/2294
  164. ####
  165. RUN pip2 install \
  166. configparser==4.0.2 \
  167. pylint==1.9.2 \
  168. isort==4.3.21
  169. ####
  170. # Install dateutil.parser
  171. ####
  172. RUN pip2 install python-dateutil==2.7.3
  173. ###
  174. # Install node.js 8.17.0 for web UI framework (4.2.6 ships with Xenial)
  175. ###
  176. RUN curl -L -s -S https://deb.nodesource.com/setup_8.x | bash - \
  177. && apt-get install -y --no-install-recommends nodejs=8.17.0-1nodesource1 \
  178. && apt-get clean \
  179. && rm -rf /var/lib/apt/lists/* \
  180. && npm install -g bower@1.8.8
  181. ###
  182. ## Install Yarn 1.12.1 for web UI framework
  183. ####
  184. RUN curl -s -S https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
  185. && echo 'deb https://dl.yarnpkg.com/debian/ stable main' > /etc/apt/sources.list.d/yarn.list \
  186. && apt-get -q update \
  187. && apt-get install -y --no-install-recommends yarn=1.12.1-1 \
  188. && apt-get clean \
  189. && rm -rf /var/lib/apt/lists/*
  190. ###
  191. # Install hadolint
  192. ####
  193. RUN curl -L -s -S \
  194. https://github.com/hadolint/hadolint/releases/download/v1.11.1/hadolint-Linux-x86_64 \
  195. -o /bin/hadolint \
  196. && chmod a+rx /bin/hadolint \
  197. && shasum -a 512 /bin/hadolint | \
  198. awk '$1!="734e37c1f6619cbbd86b9b249e69c9af8ee1ea87a2b1ff71dccda412e9dac35e63425225a95d71572091a3f0a11e9a04c2fc25d9e91b840530c26af32b9891ca" {exit(1)}'
  199. ###
  200. # Avoid out of memory errors in builds
  201. ###
  202. ENV MAVEN_OPTS -Xms256m -Xmx1536m -Dhttps.protocols=TLSv1.2 -Dhttps.cipherSuites=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
  203. ###
  204. # Everything past this point is either not needed for testing or breaks Yetus.
  205. # So tell Yetus not to read the rest of the file:
  206. # YETUS CUT HERE
  207. ###
  208. # Hugo static website generator (for new hadoop site and Ozone docs)
  209. RUN curl -L -o hugo.deb https://github.com/gohugoio/hugo/releases/download/v0.30.2/hugo_0.30.2_Linux-64bit.deb \
  210. && dpkg --install hugo.deb \
  211. && rm hugo.deb
  212. # Add a welcome message and environment checks.
  213. COPY hadoop_env_checks.sh /root/hadoop_env_checks.sh
  214. RUN chmod 755 /root/hadoop_env_checks.sh
  215. # hadolint ignore=SC2016
  216. RUN echo '${HOME}/hadoop_env_checks.sh' >> /root/.bashrc