Dockerfile_centos_7 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. # Install packages from yum
  29. ######
  30. # hadolint ignore=DL3008,SC2046
  31. RUN yum update -y \
  32. && yum install -y \
  33. centos-release-scl \
  34. python3 \
  35. && yum install -y $(pkg-resolver/resolve.py centos:7)
  36. # Set GCC 9 as the default C/C++ compiler
  37. RUN echo "source /opt/rh/devtoolset-9/enable" >> /etc/bashrc
  38. SHELL ["/bin/bash", "--login", "-c"]
  39. # TODO: Set locale
  40. ######
  41. # Set env vars required to build Hadoop
  42. ######
  43. ENV MAVEN_HOME /opt/maven
  44. ENV PATH "${PATH}:${MAVEN_HOME}/bin"
  45. # JAVA_HOME must be set in Maven >= 3.5.0 (MNG-6003)
  46. ENV JAVA_HOME /usr/lib/jvm/java-1.8.0
  47. #######
  48. # Set env vars for SpotBugs
  49. #######
  50. ENV SPOTBUGS_HOME /opt/spotbugs
  51. #######
  52. # Set env vars for Google Protobuf
  53. #######
  54. ENV PROTOBUF_HOME /opt/protobuf
  55. ENV PATH "${PATH}:/opt/protobuf/bin"
  56. ######
  57. # Install packages
  58. ######
  59. RUN pkg-resolver/install-maven.sh centos:7
  60. RUN pkg-resolver/install-cmake.sh centos:7
  61. RUN pkg-resolver/install-zstandard.sh centos:7
  62. RUN pkg-resolver/install-yasm.sh centos:7
  63. RUN pkg-resolver/install-protobuf.sh centos:7
  64. RUN pkg-resolver/install-boost.sh centos:7
  65. RUN pkg-resolver/install-spotbugs.sh centos:7
  66. RUN pkg-resolver/install-nodejs.sh centos:7
  67. RUN pkg-resolver/install-common-pkgs.sh