Dockerfile_debian_10 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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 debian:10
  19. WORKDIR /root
  20. SHELL ["/bin/bash", "-o", "pipefail", "-c"]
  21. #####
  22. # Disable suggests/recommends
  23. #####
  24. RUN echo APT::Install-Recommends "0"\; > /etc/apt/apt.conf.d/10disableextras
  25. RUN echo APT::Install-Suggests "0"\; >> /etc/apt/apt.conf.d/10disableextras
  26. #####
  27. # For installing the latest packages
  28. #####
  29. RUN echo 'deb http://deb.debian.org/debian testing main' >> /etc/apt/sources.list
  30. ENV DEBIAN_FRONTEND noninteractive
  31. ENV DEBCONF_TERSE true
  32. ######
  33. # Platform package dependency resolver
  34. ######
  35. COPY pkg-resolver pkg-resolver
  36. RUN chmod a+x pkg-resolver/*.sh pkg-resolver/*.py \
  37. && chmod a+r pkg-resolver/*.json
  38. ######
  39. # Install packages from apt
  40. ######
  41. # hadolint ignore=DL3008,SC2046
  42. RUN apt-get -q update \
  43. && apt-get -q install -y --no-install-recommends python3 \
  44. && apt-get -q install -y --no-install-recommends $(pkg-resolver/resolve.py debian:10) \
  45. && apt-get clean \
  46. && rm -rf /var/lib/apt/lists/*
  47. # TODO : Set locale
  48. ######
  49. # Set env vars required to build Hadoop
  50. ######
  51. ENV MAVEN_HOME /usr
  52. # JAVA_HOME must be set in Maven >= 3.5.0 (MNG-6003)
  53. ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64
  54. #######
  55. # Set env vars for SpotBugs 4.2.2
  56. #######
  57. ENV SPOTBUGS_HOME /opt/spotbugs
  58. #######
  59. # Set env vars for Google Protobuf 3.7.1
  60. #######
  61. ENV PROTOBUF_HOME /opt/protobuf
  62. ENV PATH "${PATH}:/opt/protobuf/bin"
  63. ###
  64. # Avoid out of memory errors in builds
  65. ###
  66. ENV MAVEN_OPTS -Xms256m -Xmx3072m
  67. # Skip gpg verification when downloading Yetus via yetus-wrapper
  68. ENV HADOOP_SKIP_YETUS_VERIFICATION true
  69. ####
  70. # Install packages
  71. ####
  72. RUN pkg-resolver/install-common-pkgs.sh
  73. RUN pkg-resolver/install-spotbugs.sh debian:10
  74. RUN pkg-resolver/install-boost.sh debian:10
  75. RUN pkg-resolver/install-protobuf.sh debian:10
  76. RUN pkg-resolver/install-hadolint.sh debian:10
  77. RUN pkg-resolver/install-intel-isa-l.sh debian:10
  78. ###
  79. # Everything past this point is either not needed for testing or breaks Yetus.
  80. # So tell Yetus not to read the rest of the file:
  81. # YETUS CUT HERE
  82. ###
  83. # Add a welcome message and environment checks.
  84. COPY hadoop_env_checks.sh /root/hadoop_env_checks.sh
  85. RUN chmod 755 /root/hadoop_env_checks.sh
  86. # hadolint ignore=SC2016
  87. RUN echo '${HOME}/hadoop_env_checks.sh' >> /root/.bashrc