Dockerfile_centos_8 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. ######
  22. # Platform package dependency resolver
  23. ######
  24. COPY pkg-resolver pkg-resolver
  25. RUN chmod a+x pkg-resolver/*.sh pkg-resolver/*.py \
  26. && chmod a+r pkg-resolver/*.json
  27. ######
  28. # Centos 8 has reached its EOL and the packages
  29. # are no longer available on mirror.centos.org site.
  30. # Please see https://www.centos.org/centos-linux-eol/
  31. ######
  32. RUN pkg-resolver/set-vault-as-baseurl-centos.sh centos:8
  33. ######
  34. # Install packages from yum
  35. ######
  36. # hadolint ignore=DL3008,SC2046
  37. RUN yum update -y \
  38. && yum install -y python3 \
  39. && yum install -y $(pkg-resolver/resolve.py centos:8)
  40. ####
  41. # Install EPEL
  42. ####
  43. RUN pkg-resolver/install-epel.sh centos:8
  44. RUN dnf --enablerepo=powertools install -y \
  45. doxygen \
  46. snappy-devel \
  47. yasm
  48. RUN dnf install -y \
  49. bouncycastle \
  50. gcc-toolset-9-gcc \
  51. gcc-toolset-9-gcc-c++ \
  52. libpmem-devel
  53. # Set GCC 9 as the default C/C++ compiler
  54. RUN echo "source /opt/rh/gcc-toolset-9/enable" >> /etc/bashrc
  55. SHELL ["/bin/bash", "--login", "-c"]
  56. ######
  57. # Set the environment variables needed for CMake
  58. # to find and use GCC 9 for compilation
  59. ######
  60. ENV GCC_HOME "/opt/rh/gcc-toolset-9"
  61. ENV CC "${GCC_HOME}/root/usr/bin/gcc"
  62. ENV CXX "${GCC_HOME}/root/usr/bin/g++"
  63. ENV MODULES_RUN_QUARANTINE "LD_LIBRARY_PATH LD_PRELOAD"
  64. ENV MODULES_CMD "/usr/share/Modules/libexec/modulecmd.tcl"
  65. ENV SHLVL 1
  66. ENV MODULEPATH "/etc/scl/modulefiles:/usr/share/Modules/modulefiles:/etc/modulefiles:/usr/share/modulefiles"
  67. ENV MODULEPATH_modshare "/usr/share/modulefiles:1:/usr/share/Modules/modulefiles:1:/etc/modulefiles:1"
  68. ENV MODULESHOME "/usr/share/Modules"
  69. ENV LD_LIBRARY_PATH "${GCC_HOME}/root/usr/lib64:${GCC_HOME}/root/usr/lib:${GCC_HOME}/root/usr/lib64/dyninst:${GCC_HOME}/root/usr/lib/dyninst:${GCC_HOME}/root/usr/lib64:${GCC_HOME}/root/usr/lib:/usr/lib:/usr/lib64"
  70. ENV PCP_DIR "${GCC_HOME}/root"
  71. ENV MANPATH "${GCC_HOME}/root/usr/share/man::"
  72. ENV PATH "${GCC_HOME}/root/usr/bin:/usr/share/Modules/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
  73. ENV PKG_CONFIG_PATH "${GCC_HOME}/root/usr/lib64/pkgconfig"
  74. ENV INFOPATH "${GCC_HOME}/root/usr/share/info"
  75. # TODO: Set locale
  76. ######
  77. # Set env vars required to build Hadoop
  78. ######
  79. ENV MAVEN_HOME /opt/maven
  80. ENV PATH "${PATH}:${MAVEN_HOME}/bin"
  81. # JAVA_HOME must be set in Maven >= 3.5.0 (MNG-6003)
  82. ENV JAVA_HOME /usr/lib/jvm/java-1.8.0
  83. #######
  84. # Set env vars for SpotBugs
  85. #######
  86. ENV SPOTBUGS_HOME /opt/spotbugs
  87. #######
  88. # Set env vars for Google Protobuf 3.21.12
  89. #######
  90. ENV PROTOBUF_HOME /opt/protobuf
  91. ENV PATH "${PATH}:/opt/protobuf/bin"
  92. ######
  93. # Install packages
  94. ######
  95. RUN pkg-resolver/install-maven.sh centos:8
  96. RUN pkg-resolver/install-cmake.sh centos:8
  97. RUN pkg-resolver/install-boost.sh centos:8
  98. RUN pkg-resolver/install-spotbugs.sh centos:8
  99. RUN pkg-resolver/install-protobuf.sh centos:8
  100. RUN pkg-resolver/install-zstandard.sh centos:8
  101. RUN pkg-resolver/install-common-pkgs.sh