Dockerfile 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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:trusty
  19. WORKDIR /root
  20. ENV DEBIAN_FRONTEND noninteractive
  21. ENV DEBCONF_TERSE true
  22. ######
  23. # Install common dependencies from packages
  24. #
  25. # WARNING: DO NOT PUT JAVA APPS HERE! Otherwise they will install default
  26. # Ubuntu Java. See Java section below!
  27. ######
  28. RUN apt-get -q update && apt-get -q install --no-install-recommends -y \
  29. build-essential \
  30. bzip2 \
  31. curl \
  32. doxygen \
  33. fuse \
  34. g++ \
  35. gcc \
  36. git \
  37. gnupg-agent \
  38. make \
  39. libbz2-dev \
  40. libcurl4-openssl-dev \
  41. libfuse-dev \
  42. libprotobuf-dev \
  43. libprotoc-dev \
  44. libsnappy-dev \
  45. libssl-dev \
  46. libtool \
  47. pinentry-curses \
  48. pkg-config \
  49. protobuf-compiler \
  50. protobuf-c-compiler \
  51. python \
  52. python2.7 \
  53. python2.7-dev \
  54. python-pip \
  55. rsync \
  56. snappy \
  57. zlib1g-dev
  58. #######
  59. # Oracle Java
  60. #######
  61. RUN echo "dot_style = mega" > "/root/.wgetrc"
  62. RUN echo "quiet = on" >> "/root/.wgetrc"
  63. RUN apt-get -q install --no-install-recommends -y software-properties-common
  64. RUN add-apt-repository -y ppa:webupd8team/java
  65. RUN apt-get -q update
  66. # Auto-accept the Oracle JDK license
  67. RUN echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections
  68. RUN apt-get -q install --no-install-recommends -y oracle-java8-installer
  69. ####
  70. # Apps that require Java
  71. ###
  72. RUN apt-get -q update && apt-get -q install --no-install-recommends -y ant
  73. ######
  74. # Install Apache Maven
  75. ######
  76. RUN mkdir -p /opt/maven && \
  77. curl -L -s -S \
  78. https://www-us.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz \
  79. -o /opt/maven.tar.gz && \
  80. tar xzf /opt/maven.tar.gz --strip-components 1 -C /opt/maven
  81. ENV MAVEN_HOME /opt/maven
  82. ENV PATH "${PATH}:/opt/maven/bin"
  83. ######
  84. # Install cmake
  85. ######
  86. RUN mkdir -p /opt/cmake && \
  87. curl -L -s -S \
  88. https://cmake.org/files/v3.1/cmake-3.1.0-Linux-x86_64.tar.gz \
  89. -o /opt/cmake.tar.gz && \
  90. tar xzf /opt/cmake.tar.gz --strip-components 1 -C /opt/cmake
  91. ENV CMAKE_HOME /opt/cmake
  92. ENV PATH "${PATH}:/opt/cmake/bin"
  93. ######
  94. # Install findbugs
  95. ######
  96. RUN mkdir -p /opt/findbugs && \
  97. curl -L -s -S \
  98. https://sourceforge.net/projects/findbugs/files/findbugs/3.0.1/findbugs-noUpdateChecks-3.0.1.tar.gz/download \
  99. -o /opt/findbugs.tar.gz && \
  100. tar xzf /opt/findbugs.tar.gz --strip-components 1 -C /opt/findbugs
  101. ENV FINDBUGS_HOME /opt/findbugs
  102. ENV PATH "${PATH}:/opt/findbugs/bin"
  103. ####
  104. # Install shellcheck
  105. ####
  106. RUN apt-get -q install -y cabal-install
  107. RUN mkdir /root/.cabal
  108. RUN echo "remote-repo: hackage.fpcomplete.com:http://hackage.fpcomplete.com/" >> /root/.cabal/config
  109. #RUN echo "remote-repo: hackage.haskell.org:http://hackage.haskell.org/" > /root/.cabal/config
  110. RUN echo "remote-repo-cache: /root/.cabal/packages" >> /root/.cabal/config
  111. RUN cabal update
  112. RUN cabal install shellcheck --global
  113. ####
  114. # Install bats
  115. ####
  116. RUN add-apt-repository -y ppa:duggan/bats
  117. RUN apt-get -q update
  118. RUN apt-get -q install --no-install-recommends -y bats
  119. ####
  120. # Install pylint
  121. ####
  122. RUN pip install pylint
  123. ####
  124. # Install dateutil.parser
  125. ####
  126. RUN pip install python-dateutil
  127. ###
  128. # Avoid out of memory errors in builds
  129. ###
  130. ENV MAVEN_OPTS -Xms256m -Xmx512m
  131. ###
  132. # Install node js tools for web UI frameowkr
  133. ###
  134. RUN apt-get -y install nodejs && \
  135. ln -s /usr/bin/nodejs /usr/bin/node && \
  136. apt-get -y install npm && \
  137. npm install npm@latest -g && \
  138. npm install -g bower && \
  139. npm install -g ember-cli
  140. ###
  141. # Everything past this point is either not needed for testing or breaks Yetus.
  142. # So tell Yetus not to read the rest of the file:
  143. # YETUS CUT HERE
  144. ###
  145. ####
  146. # Install Forrest (for Apache Hadoop website)
  147. ###
  148. RUN mkdir -p /usr/local/apache-forrest ; \
  149. curl -s -S -O http://archive.apache.org/dist/forrest/0.8/apache-forrest-0.8.tar.gz ; \
  150. tar xzf *forrest* --strip-components 1 -C /usr/local/apache-forrest ; \
  151. echo 'forrest.home=/usr/local/apache-forrest' > build.properties
  152. # Add a welcome message and environment checks.
  153. ADD hadoop_env_checks.sh /root/hadoop_env_checks.sh
  154. RUN chmod 755 /root/hadoop_env_checks.sh
  155. RUN echo '~/hadoop_env_checks.sh' >> /root/.bashrc