Dockerfile 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #
  2. # Licensed to the Apache Software Foundation (ASF) under one or more
  3. # contributor license agreements. See the NOTICE file distributed with
  4. # this work for additional information regarding copyright ownership.
  5. # The ASF licenses this file to You under the Apache License, Version 2.0
  6. # (the "License"); you may not use this file except in compliance with
  7. # 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. #
  17. FROM openjdk:8-jre-slim-buster
  18. ARG VERSION
  19. ARG DEBIAN_FRONTEND=noninteractive
  20. ENV TZ Asia/Shanghai
  21. ENV LANG C.UTF-8
  22. ENV DOCKER true
  23. ENV DOLPHINSCHEDULER_HOME /opt/dolphinscheduler
  24. # 1. install command/library/software
  25. # If install slowly, you can replcae debian's mirror with new mirror, Example:
  26. # RUN { \
  27. # echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free"; \
  28. # echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free"; \
  29. # echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free"; \
  30. # echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free"; \
  31. # } > /etc/apt/sources.list
  32. RUN apt-get update && \
  33. apt-get install -y --no-install-recommends tzdata dos2unix python supervisor procps psmisc netcat sudo tini && \
  34. echo "Asia/Shanghai" > /etc/timezone && \
  35. rm -f /etc/localtime && \
  36. dpkg-reconfigure tzdata && \
  37. rm -rf /var/lib/apt/lists/* /tmp/*
  38. # 2. add dolphinscheduler
  39. ADD ./apache-dolphinscheduler-${VERSION}-bin.tar.gz /opt/
  40. RUN ln -s -r /opt/apache-dolphinscheduler-${VERSION}-bin /opt/dolphinscheduler
  41. WORKDIR /opt/apache-dolphinscheduler-${VERSION}-bin
  42. # 3. add configuration and modify permissions and set soft links
  43. COPY ./checkpoint.sh /root/checkpoint.sh
  44. COPY ./startup-init-conf.sh /root/startup-init-conf.sh
  45. COPY ./startup.sh /root/startup.sh
  46. COPY ./conf/dolphinscheduler/*.tpl /opt/dolphinscheduler/conf/
  47. COPY ./conf/dolphinscheduler/logback/* /opt/dolphinscheduler/conf/
  48. COPY ./conf/dolphinscheduler/supervisor/supervisor.ini /etc/supervisor/conf.d/
  49. COPY ./conf/dolphinscheduler/env/dolphinscheduler_env.sh.tpl /opt/dolphinscheduler/conf/env/
  50. RUN sed -i 's/*.conf$/*.ini/' /etc/supervisor/supervisord.conf && \
  51. dos2unix /root/checkpoint.sh && \
  52. dos2unix /root/startup-init-conf.sh && \
  53. dos2unix /root/startup.sh && \
  54. dos2unix /opt/dolphinscheduler/script/*.sh && \
  55. dos2unix /opt/dolphinscheduler/bin/*.sh && \
  56. rm -f /bin/sh && \
  57. ln -s /bin/bash /bin/sh && \
  58. mkdir -p /tmp/xls && \
  59. echo PS1=\'\\w \\$ \' >> ~/.bashrc && \
  60. echo "Set disable_coredump false" >> /etc/sudo.conf
  61. # 4. expose port
  62. EXPOSE 5678 1234 12345 50051 50052
  63. ENTRYPOINT ["/usr/bin/tini", "--", "/root/startup.sh"]