Dockerfile_debian_10 3.1 KB

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