Dockerfile 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  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 7
  77. #######
  78. # hadolint ignore=DL3008
  79. RUN add-apt-repository ppa:openjdk-r/ppa
  80. RUN apt-get -q update \
  81. && apt-get -q install -y --no-install-recommends openjdk-7-jdk \
  82. && apt-get clean \
  83. && rm -rf /var/lib/apt/lists/*
  84. ######
  85. # Install cmake 3.1.0 (3.5.1 ships with Xenial)
  86. ######
  87. RUN mkdir -p /opt/cmake \
  88. && curl -L -s -S \
  89. https://cmake.org/files/v3.1/cmake-3.1.0-Linux-x86_64.tar.gz \
  90. -o /opt/cmake.tar.gz \
  91. && tar xzf /opt/cmake.tar.gz --strip-components 1 -C /opt/cmake
  92. ENV CMAKE_HOME /opt/cmake
  93. ENV PATH "${PATH}:/opt/cmake/bin"
  94. ######
  95. # Install Google Protobuf 2.5.0 (2.6.0 ships with Xenial)
  96. ######
  97. # hadolint ignore=DL3003
  98. RUN mkdir -p /opt/protobuf-src \
  99. && curl -L -s -S \
  100. https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz \
  101. -o /opt/protobuf.tar.gz \
  102. && tar xzf /opt/protobuf.tar.gz --strip-components 1 -C /opt/protobuf-src \
  103. && cd /opt/protobuf-src \
  104. && ./configure --prefix=/opt/protobuf \
  105. && make install \
  106. && cd /root \
  107. && rm -rf /opt/protobuf-src
  108. ENV PROTOBUF_HOME /opt/protobuf
  109. ENV PATH "${PATH}:/opt/protobuf/bin"
  110. ######
  111. # Install Apache Maven 3.3.9 (3.3.9 ships with Xenial)
  112. ######
  113. # hadolint ignore=DL3008
  114. RUN apt-get -q update \
  115. && apt-get -q install -y --no-install-recommends maven \
  116. && apt-get clean \
  117. && rm -rf /var/lib/apt/lists/*
  118. ENV MAVEN_HOME /usr
  119. ######
  120. # Install Apache Ant 1.9.6 (1.9.6 ships with Xenial)
  121. ######
  122. # hadolint ignore=DL3008
  123. RUN apt-get -q update \
  124. && apt-get -q install -y --no-install-recommends ant \
  125. && apt-get clean \
  126. && rm -rf /var/lib/apt/lists/*
  127. ######
  128. # Install findbugs 3.0.1 (3.0.1 ships with Xenial)
  129. ######
  130. # hadolint ignore=DL3008
  131. RUN apt-get -q update \
  132. && apt-get -q install -y --no-install-recommends findbugs \
  133. && apt-get clean \
  134. && rm -rf /var/lib/apt/lists/*
  135. ENV FINDBUGS_HOME /usr
  136. ####
  137. # Install shellcheck (0.4.6, the latest as of 2017-09-26)
  138. ####
  139. # hadolint ignore=DL3008
  140. RUN add-apt-repository -y ppa:jonathonf/ghc-8.0.2 \
  141. && apt-get -q update \
  142. && apt-get -q install -y --no-install-recommends shellcheck \
  143. && apt-get clean \
  144. && rm -rf /var/lib/apt/lists/*
  145. ####
  146. # Install bats (0.4.0, the latest as of 2017-09-26, ships with Xenial)
  147. ####
  148. # hadolint ignore=DL3008
  149. RUN apt-get -q update \
  150. && apt-get -q install -y --no-install-recommends bats \
  151. && apt-get clean \
  152. && rm -rf /var/lib/apt/lists/*
  153. ####
  154. # Install pylint at fixed version (2.0.0 removed python2 support)
  155. # https://github.com/PyCQA/pylint/issues/2294
  156. ####
  157. RUN pip2 install pylint==1.9.2
  158. ####
  159. # Install dateutil.parser
  160. ####
  161. RUN pip2 install python-dateutil==2.7.3
  162. ###
  163. # Install node.js for web UI framework (4.2.6 ships with Xenial)
  164. ###
  165. # hadolint ignore=DL3008, DL3016
  166. RUN apt-get -q update \
  167. && apt-get install -y --no-install-recommends nodejs npm \
  168. && apt-get clean \
  169. && rm -rf /var/lib/apt/lists/* \
  170. && ln -s /usr/bin/nodejs /usr/bin/node \
  171. && npm install npm@latest -g \
  172. && npm install -g jshint
  173. ###
  174. # Install hadolint
  175. ####
  176. RUN curl -L -s -S \
  177. https://github.com/hadolint/hadolint/releases/download/v1.11.1/hadolint-Linux-x86_64 \
  178. -o /bin/hadolint \
  179. && chmod a+rx /bin/hadolint \
  180. && shasum -a 512 /bin/hadolint | \
  181. awk '$1!="734e37c1f6619cbbd86b9b249e69c9af8ee1ea87a2b1ff71dccda412e9dac35e63425225a95d71572091a3f0a11e9a04c2fc25d9e91b840530c26af32b9891ca" {exit(1)}'
  182. ###
  183. # Avoid out of memory errors in builds
  184. ###
  185. ENV MAVEN_OPTS -Xms256m -Xmx1536m
  186. ###
  187. # Everything past this point is either not needed for testing or breaks Yetus.
  188. # So tell Yetus not to read the rest of the file:
  189. # YETUS CUT HERE
  190. ###
  191. ####
  192. # Install svn & Forrest (for Apache Hadoop website)
  193. ###
  194. # hadolint ignore=DL3008
  195. RUN apt-get -q update \
  196. && apt-get -q install -y --no-install-recommends subversion \
  197. && apt-get clean \
  198. && rm -rf /var/lib/apt/lists/*
  199. RUN mkdir -p /opt/apache-forrest \
  200. && curl -L -s -S \
  201. https://archive.apache.org/dist/forrest/0.8/apache-forrest-0.8.tar.gz \
  202. -o /opt/forrest.tar.gz \
  203. && tar xzf /opt/forrest.tar.gz --strip-components 1 -C /opt/apache-forrest
  204. RUN echo 'forrest.home=/opt/apache-forrest' > build.properties
  205. ENV FORREST_HOME=/opt/apache-forrest
  206. # Hugo static website generator (for new hadoop site and Ozone docs)
  207. RUN curl -L -o hugo.deb https://github.com/gohugoio/hugo/releases/download/v0.30.2/hugo_0.30.2_Linux-64bit.deb \
  208. && dpkg --install hugo.deb \
  209. && rm hugo.deb
  210. # Add a welcome message and environment checks.
  211. COPY hadoop_env_checks.sh /root/hadoop_env_checks.sh
  212. RUN chmod 755 /root/hadoop_env_checks.sh
  213. # hadolint ignore=SC2016
  214. RUN echo '${HOME}/hadoop_env_checks.sh' >> /root/.bashrc