Dockerfile 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. ARG JAVA_VERSION=17
  17. # Ubuntu 22.04 LTS
  18. FROM eclipse-temurin:${JAVA_VERSION}-jammy
  19. RUN apt update -q \
  20. && DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \
  21. jq \
  22. krb5-user \
  23. ncat \
  24. python3-pip \
  25. python-is-python3 \
  26. sudo \
  27. && apt clean
  28. # Robot Framework for testing
  29. RUN pip install robotframework \
  30. && rm -fr ~/.cache/pip
  31. #dumb init for proper init handling
  32. RUN set -eux; \
  33. ARCH="$(arch)"; \
  34. v=1.2.5 ; \
  35. url="https://github.com/Yelp/dumb-init/releases/download/v${v}/dumb-init_${v}_${ARCH}"; \
  36. case "${ARCH}" in \
  37. x86_64) \
  38. sha256='e874b55f3279ca41415d290c512a7ba9d08f98041b28ae7c2acb19a545f1c4df'; \
  39. ;; \
  40. aarch64) \
  41. sha256='b7d648f97154a99c539b63c55979cd29f005f88430fb383007fe3458340b795e'; \
  42. ;; \
  43. *) echo "Unsupported architecture: ${ARCH}"; exit 1 ;; \
  44. esac \
  45. && curl -L ${url} -o dumb-init \
  46. && echo -n "${sha256} *dumb-init" | sha256sum -c - \
  47. && chmod +x dumb-init \
  48. && mv dumb-init /usr/local/bin/dumb-init
  49. #byteman test for development
  50. RUN curl -Lo /opt/byteman.jar https://repo.maven.apache.org/maven2/org/jboss/byteman/byteman/4.0.23/byteman-4.0.23.jar \
  51. && chmod o+r /opt/byteman.jar
  52. #async profiler for development profiling
  53. RUN set -eux; \
  54. ARCH="$(arch)"; \
  55. v=2.8.3; \
  56. case "${ARCH}" in \
  57. x86_64) \
  58. url="https://github.com/jvm-profiling-tools/async-profiler/releases/download/v${v}/async-profiler-${v}-linux-x64.tar.gz" \
  59. ;; \
  60. aarch64) \
  61. url="https://github.com/jvm-profiling-tools/async-profiler/releases/download/v${v}/async-profiler-${v}-linux-arm64.tar.gz" \
  62. ;; \
  63. *) echo "Unsupported architecture: ${ARCH}"; exit 1 ;; \
  64. esac \
  65. && curl -L ${url} | tar xvz \
  66. && mv async-profiler-* /opt/profiler \
  67. && chmod -R go+rX /opt/profiler
  68. RUN mkdir -p /etc/security/keytabs \
  69. && chmod -R a+wr /etc/security/keytabs
  70. RUN groupadd --gid 1000 hadoop \
  71. && useradd --uid 1000 hadoop --gid 100 --home /opt/hadoop \
  72. && mkdir -p /opt/hadoop \
  73. && chown hadoop:users /opt/hadoop \
  74. && echo "hadoop ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
  75. RUN mkdir -p /etc/hadoop \
  76. && chmod 1777 /etc/hadoop \
  77. && mkdir -p /var/log/hadoop \
  78. && chmod 1777 /var/log/hadoop
  79. ENV HADOOP_CONF_DIR=/etc/hadoop
  80. ENV HADOOP_LOG_DIR=/var/log/hadoop
  81. ENV PATH=$PATH:/opt/hadoop/bin
  82. COPY --chown=hadoop --chmod=755 scripts /opt/
  83. COPY --chmod=644 krb5.conf /etc/
  84. WORKDIR /opt/hadoop
  85. USER hadoop
  86. ENTRYPOINT ["/usr/local/bin/dumb-init", "--", "/opt/starter.sh"]