Dockerfile 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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-jdk-alpine
  18. ARG VERSION
  19. ENV TZ Asia/Shanghai
  20. ENV LANG C.UTF-8
  21. ENV DOCKER true
  22. # 1. install command/library/software
  23. # If install slowly, you can replcae alpine's mirror with aliyun's mirror, Example:
  24. # RUN sed -i "s/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g" /etc/apk/repositories
  25. # RUN sed -i 's/dl-cdn.alpinelinux.org/mirror.tuna.tsinghua.edu.cn/g' /etc/apk/repositories
  26. RUN apk update && \
  27. apk add --no-cache tzdata dos2unix bash python2 python3 supervisor procps sudo shadow tini postgresql-client && \
  28. cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
  29. apk del tzdata && \
  30. rm -rf /var/cache/apk/*
  31. # 2. add dolphinscheduler
  32. ADD ./apache-dolphinscheduler-incubating-${VERSION}-dolphinscheduler-bin.tar.gz /opt/
  33. RUN ln -s /opt/apache-dolphinscheduler-incubating-${VERSION}-dolphinscheduler-bin /opt/dolphinscheduler
  34. ENV DOLPHINSCHEDULER_HOME /opt/dolphinscheduler
  35. # 3. add configuration and modify permissions and set soft links
  36. COPY ./checkpoint.sh /root/checkpoint.sh
  37. COPY ./startup-init-conf.sh /root/startup-init-conf.sh
  38. COPY ./startup.sh /root/startup.sh
  39. COPY ./conf/dolphinscheduler/*.tpl /opt/dolphinscheduler/conf/
  40. COPY ./conf/dolphinscheduler/logback/* /opt/dolphinscheduler/conf/
  41. COPY ./conf/dolphinscheduler/supervisor/supervisor.ini /etc/supervisor.d/
  42. COPY ./conf/dolphinscheduler/env/dolphinscheduler_env.sh.tpl /opt/dolphinscheduler/conf/env/
  43. RUN dos2unix /root/checkpoint.sh && \
  44. dos2unix /root/startup-init-conf.sh && \
  45. dos2unix /root/startup.sh && \
  46. dos2unix /opt/dolphinscheduler/script/*.sh && \
  47. dos2unix /opt/dolphinscheduler/bin/*.sh && \
  48. rm -rf /bin/sh && \
  49. ln -s /bin/bash /bin/sh && \
  50. mkdir -p /var/mail /tmp/xls && \
  51. echo "Set disable_coredump false" >> /etc/sudo.conf
  52. # 4. expose port
  53. EXPOSE 5678 1234 12345 50051 50052
  54. ENTRYPOINT ["/sbin/tini", "--", "/root/startup.sh"]