Dockerfile_centos_7 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. ######
  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 7 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:7
  33. ######
  34. # Install packages from yum
  35. ######
  36. # hadolint ignore=DL3008,SC2046
  37. RUN yum update -y \
  38. && yum groupinstall -y "Development Tools" \
  39. && yum install -y \
  40. centos-release-scl \
  41. python3
  42. # Apply the script again because centos-release-scl creates new YUM repo files
  43. RUN pkg-resolver/set-vault-as-baseurl-centos.sh centos:7
  44. # hadolint ignore=DL3008,SC2046
  45. RUN yum install -y $(pkg-resolver/resolve.py centos:7)
  46. # Set GCC 9 as the default C/C++ compiler
  47. RUN echo "source /opt/rh/devtoolset-9/enable" >> /etc/bashrc
  48. SHELL ["/bin/bash", "--login", "-c"]
  49. ######
  50. # Set the environment variables needed for CMake
  51. # to find and use GCC 9 for compilation
  52. ######
  53. ENV GCC_HOME "/opt/rh/devtoolset-9"
  54. ENV CC "${GCC_HOME}/root/usr/bin/gcc"
  55. ENV CXX "${GCC_HOME}/root/usr/bin/g++"
  56. ENV SHLVL 1
  57. 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"
  58. ENV PCP_DIR "${GCC_HOME}/root"
  59. ENV MANPATH "${GCC_HOME}/root/usr/share/man:"
  60. ENV PATH "${GCC_HOME}/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
  61. ENV PKG_CONFIG_PATH "${GCC_HOME}/root/usr/lib64/pkgconfig"
  62. ENV INFOPATH "${GCC_HOME}/root/usr/share/info"
  63. # TODO: Set locale
  64. ######
  65. # Set env vars required to build Hadoop
  66. ######
  67. ENV MAVEN_HOME /opt/maven
  68. ENV PATH "${PATH}:${MAVEN_HOME}/bin"
  69. # JAVA_HOME must be set in Maven >= 3.5.0 (MNG-6003)
  70. ENV JAVA_HOME /usr/lib/jvm/java-1.8.0
  71. #######
  72. # Set env vars for SpotBugs
  73. #######
  74. ENV SPOTBUGS_HOME /opt/spotbugs
  75. #######
  76. # Set env vars for Google Protobuf 3.21.12
  77. #######
  78. ENV PROTOBUF_HOME /opt/protobuf
  79. ENV PATH "${PATH}:/opt/protobuf/bin"
  80. ######
  81. # Install packages
  82. ######
  83. RUN pkg-resolver/install-maven.sh centos:7
  84. RUN pkg-resolver/install-cmake.sh centos:7
  85. RUN pkg-resolver/install-zstandard.sh centos:7
  86. RUN pkg-resolver/install-yasm.sh centos:7
  87. RUN pkg-resolver/install-protobuf.sh centos:7
  88. RUN pkg-resolver/install-boost.sh centos:7
  89. RUN pkg-resolver/install-spotbugs.sh centos:7
  90. RUN pkg-resolver/install-nodejs.sh centos:7
  91. RUN pkg-resolver/install-git.sh centos:7
  92. RUN pkg-resolver/install-common-pkgs.sh