Dockerfile_centos_8 5.2 KB

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