Dockerfile_centos_7 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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 centos:7
  19. WORKDIR /root
  20. SHELL ["/bin/bash", "-o", "pipefail", "-c"]
  21. RUN yum update -y \
  22. && yum install -y centos-release-scl \
  23. && yum install -y devtoolset-9 \
  24. && yum install -y \
  25. ant \
  26. build-essential \
  27. bzip2 \
  28. bzip2-devel \
  29. clang \
  30. curl \
  31. cyrus-sasl-devel \
  32. doxygen \
  33. fuse \
  34. fuse-libs \
  35. fuse-devel \
  36. git \
  37. libcurl-devel \
  38. libtirpc-devel \
  39. libpmem-devel \
  40. libtool \
  41. lz4-devel \
  42. make \
  43. openssl-devel \
  44. pinentry-curses \
  45. python3 \
  46. python3-pip \
  47. python3-setuptools \
  48. python3-wheel \
  49. rsync \
  50. snappy-devel \
  51. sudo \
  52. valgrind \
  53. zlib-devel
  54. # Set GCC 9 as the default C/C++ compiler
  55. RUN echo "source /opt/rh/devtoolset-9/enable" >> /etc/bashrc
  56. SHELL ["/bin/bash", "--login", "-c"]
  57. ####
  58. # Install Maven 3.6.3
  59. ####
  60. RUN mkdir -p /opt/maven /tmp/maven \
  61. && curl -L -s -S https://mirrors.estointernet.in/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz \
  62. -o /tmp/maven/apache-maven-3.6.3-bin.tar.gz \
  63. && tar xzf /tmp/maven/apache-maven-3.6.3-bin.tar.gz --strip-components 1 -C /opt/maven
  64. ####
  65. # Install CMake 3.19
  66. ####
  67. # hadolint ignore=DL3003
  68. RUN mkdir -p /tmp/cmake /opt/cmake \
  69. && curl -L -s -S https://cmake.org/files/v3.19/cmake-3.19.0.tar.gz -o /tmp/cmake/cmake-3.19.0.tar.gz \
  70. && tar xzf /tmp/cmake/cmake-3.19.0.tar.gz --strip-components 1 -C /opt/cmake \
  71. && cd /opt/cmake || exit && ./bootstrap \
  72. && make "-j$(nproc)" \
  73. && make install \
  74. && cd /root || exit
  75. ####
  76. # Install zstandard
  77. ####
  78. # hadolint ignore=DL3003
  79. RUN mkdir -p /opt/zstd /tmp/zstd \
  80. && curl -L -s -S https://github.com/facebook/zstd/archive/refs/tags/v1.4.9.tar.gz -o /tmp/zstd/v1.4.9.tar.gz \
  81. && tar xzf /tmp/zstd/v1.4.9.tar.gz --strip-components 1 -C /opt/zstd \
  82. && cd /opt/zstd || exit \
  83. && make "-j$(nproc)" \
  84. && make install \
  85. && cd /root || exit
  86. ######
  87. # Set env vars required to build Hadoop
  88. ######
  89. ENV MAVEN_HOME /opt/maven
  90. ENV PATH "${PATH}:${MAVEN_HOME}/bin"
  91. # JAVA_HOME must be set in Maven >= 3.5.0 (MNG-6003)
  92. ENV JAVA_HOME /usr/lib/jvm/java-1.8.0
  93. #######
  94. # Install SpotBugs 4.2.2
  95. #######
  96. RUN mkdir -p /opt/spotbugs \
  97. && curl -L -s -S https://github.com/spotbugs/spotbugs/releases/download/4.2.2/spotbugs-4.2.2.tgz \
  98. -o /opt/spotbugs.tgz \
  99. && tar xzf /opt/spotbugs.tgz --strip-components 1 -C /opt/spotbugs \
  100. && chmod +x /opt/spotbugs/bin/*
  101. ENV SPOTBUGS_HOME /opt/spotbugs
  102. #######
  103. # Install Boost 1.72 (1.71 ships with Focal)
  104. #######
  105. # hadolint ignore=DL3003
  106. RUN mkdir -p /opt/boost-library \
  107. && curl -L https://sourceforge.net/projects/boost/files/boost/1.72.0/boost_1_72_0.tar.bz2/download > boost_1_72_0.tar.bz2 \
  108. && mv boost_1_72_0.tar.bz2 /opt/boost-library \
  109. && cd /opt/boost-library \
  110. && tar --bzip2 -xf boost_1_72_0.tar.bz2 \
  111. && cd /opt/boost-library/boost_1_72_0 \
  112. && ./bootstrap.sh --prefix=/usr/ \
  113. && ./b2 --without-python install \
  114. && cd /root \
  115. && rm -rf /opt/boost-library
  116. ######
  117. # Install Google Protobuf 3.7.1 (3.6.1 ships with Focal)
  118. ######
  119. # hadolint ignore=DL3003
  120. RUN mkdir -p /opt/protobuf-src \
  121. && curl -L -s -S \
  122. https://github.com/protocolbuffers/protobuf/releases/download/v3.7.1/protobuf-java-3.7.1.tar.gz \
  123. -o /opt/protobuf.tar.gz \
  124. && tar xzf /opt/protobuf.tar.gz --strip-components 1 -C /opt/protobuf-src \
  125. && cd /opt/protobuf-src \
  126. && ./configure --prefix=/opt/protobuf \
  127. && make "-j$(nproc)" \
  128. && make install \
  129. && cd /root \
  130. && rm -rf /opt/protobuf-src
  131. ENV PROTOBUF_HOME /opt/protobuf
  132. ENV PATH "${PATH}:/opt/protobuf/bin"
  133. ####
  134. # Install Node.js
  135. ####
  136. # hadolint ignore=DL3003
  137. RUN mkdir -p /tmp/node \
  138. && curl -L -s -S https://nodejs.org/dist/v14.16.1/node-v14.16.1.tar.gz -o /tmp/node-v14.16.1.tar.gz \
  139. && tar xzf /tmp/node-v14.16.1.tar.gz --strip-components 1 -C /tmp/node \
  140. && cd /tmp/node || exit \
  141. && ./configure \
  142. && make "-j$(nproc)" \
  143. && make install \
  144. && cd /root || exit
  145. ####
  146. # Install pylint and python-dateutil
  147. ####
  148. RUN pip3 install pylint==2.6.0 python-dateutil==2.8.1
  149. ####
  150. # Install bower
  151. ####
  152. # hadolint ignore=DL3008
  153. RUN npm install -g bower@1.8.8