Dockerfile_centos_7 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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. RUN locale-gen en_US.UTF-8
  87. ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
  88. ENV PYTHONIOENCODING=utf-8
  89. ######
  90. # Set env vars required to build Hadoop
  91. ######
  92. ENV MAVEN_HOME /opt/maven
  93. ENV PATH "${PATH}:${MAVEN_HOME}/bin"
  94. # JAVA_HOME must be set in Maven >= 3.5.0 (MNG-6003)
  95. ENV JAVA_HOME /usr/lib/jvm/java-1.8.0
  96. #######
  97. # Install SpotBugs 4.2.2
  98. #######
  99. RUN mkdir -p /opt/spotbugs \
  100. && curl -L -s -S https://github.com/spotbugs/spotbugs/releases/download/4.2.2/spotbugs-4.2.2.tgz \
  101. -o /opt/spotbugs.tgz \
  102. && tar xzf /opt/spotbugs.tgz --strip-components 1 -C /opt/spotbugs \
  103. && chmod +x /opt/spotbugs/bin/*
  104. ENV SPOTBUGS_HOME /opt/spotbugs
  105. #######
  106. # Install Boost 1.72 (1.71 ships with Focal)
  107. #######
  108. # hadolint ignore=DL3003
  109. RUN mkdir -p /opt/boost-library \
  110. && 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 \
  111. && mv boost_1_72_0.tar.bz2 /opt/boost-library \
  112. && cd /opt/boost-library \
  113. && tar --bzip2 -xf boost_1_72_0.tar.bz2 \
  114. && cd /opt/boost-library/boost_1_72_0 \
  115. && ./bootstrap.sh --prefix=/usr/ \
  116. && ./b2 --without-python install \
  117. && cd /root \
  118. && rm -rf /opt/boost-library
  119. ######
  120. # Install Google Protobuf 3.7.1 (3.6.1 ships with Focal)
  121. ######
  122. # hadolint ignore=DL3003
  123. RUN mkdir -p /opt/protobuf-src \
  124. && curl -L -s -S \
  125. https://github.com/protocolbuffers/protobuf/releases/download/v3.7.1/protobuf-java-3.7.1.tar.gz \
  126. -o /opt/protobuf.tar.gz \
  127. && tar xzf /opt/protobuf.tar.gz --strip-components 1 -C /opt/protobuf-src \
  128. && cd /opt/protobuf-src \
  129. && ./configure --prefix=/opt/protobuf \
  130. && make "-j$(nproc)" \
  131. && make install \
  132. && cd /root \
  133. && rm -rf /opt/protobuf-src
  134. ENV PROTOBUF_HOME /opt/protobuf
  135. ENV PATH "${PATH}:/opt/protobuf/bin"
  136. ####
  137. # Install Node.js
  138. ####
  139. # hadolint ignore=DL3003
  140. RUN mkdir -p /tmp/node \
  141. && 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 \
  142. && tar xzf /tmp/node-v14.16.1.tar.gz --strip-components 1 -C /tmp/node \
  143. && cd /tmp/node || exit \
  144. && ./configure \
  145. && make "-j$(nproc)" \
  146. && make install \
  147. && cd /root || exit
  148. ####
  149. # Install pylint and python-dateutil
  150. ####
  151. RUN pip3 install pylint==2.6.0 python-dateutil==2.8.1
  152. ####
  153. # Install bower
  154. ####
  155. # hadolint ignore=DL3008
  156. RUN npm install -g bower@1.8.8