Dockerfile 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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 nginx:alpine
  18. ARG VERSION
  19. ENV TZ Asia/Shanghai
  20. ENV LANG C.UTF-8
  21. ENV DEBIAN_FRONTEND noninteractive
  22. #1. install dos2unix shadow bash openrc python sudo vim wget iputils net-tools ssh pip tini kazoo.
  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 apk update && \
  26. apk add --update --no-cache dos2unix shadow bash openrc python2 python3 sudo vim wget iputils net-tools openssh-server py-pip tini && \
  27. apk add --update --no-cache procps && \
  28. openrc boot && \
  29. pip install kazoo
  30. #2. install jdk
  31. RUN apk add --update --no-cache openjdk8
  32. ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk
  33. ENV PATH $JAVA_HOME/bin:$PATH
  34. #3. add dolphinscheduler
  35. ADD ./apache-dolphinscheduler-incubating-${VERSION}-dolphinscheduler-bin.tar.gz /opt/
  36. RUN mv /opt/apache-dolphinscheduler-incubating-${VERSION}-dolphinscheduler-bin/ /opt/dolphinscheduler/
  37. ENV DOLPHINSCHEDULER_HOME /opt/dolphinscheduler
  38. #4. install database, if use mysql as your backend database, you should append `mysql-client` at the end of the sentence
  39. RUN apk add --update --no-cache postgresql postgresql-contrib
  40. #5. modify nginx
  41. RUN echo "daemon off;" >> /etc/nginx/nginx.conf && \
  42. rm -rf /etc/nginx/conf.d/*
  43. COPY ./conf/nginx/dolphinscheduler.conf /etc/nginx/conf.d
  44. #6. add configuration and modify permissions and set soft links
  45. COPY ./checkpoint.sh /root/checkpoint.sh
  46. COPY ./startup-init-conf.sh /root/startup-init-conf.sh
  47. COPY ./startup.sh /root/startup.sh
  48. COPY ./conf/dolphinscheduler/*.tpl /opt/dolphinscheduler/conf/
  49. COPY ./conf/dolphinscheduler/logback/* /opt/dolphinscheduler/conf/
  50. COPY conf/dolphinscheduler/env/dolphinscheduler_env.sh /opt/dolphinscheduler/conf/env/
  51. RUN chmod +x /root/checkpoint.sh && \
  52. chmod +x /root/startup-init-conf.sh && \
  53. chmod +x /root/startup.sh && \
  54. chmod +x /opt/dolphinscheduler/conf/env/dolphinscheduler_env.sh && \
  55. chmod +x /opt/dolphinscheduler/script/*.sh && \
  56. chmod +x /opt/dolphinscheduler/bin/*.sh && \
  57. dos2unix /root/checkpoint.sh && \
  58. dos2unix /root/startup-init-conf.sh && \
  59. dos2unix /root/startup.sh && \
  60. dos2unix /opt/dolphinscheduler/conf/env/dolphinscheduler_env.sh && \
  61. dos2unix /opt/dolphinscheduler/script/*.sh && \
  62. dos2unix /opt/dolphinscheduler/bin/*.sh && \
  63. rm -rf /bin/sh && \
  64. ln -s /bin/bash /bin/sh && \
  65. mkdir -p /tmp/xls && \
  66. #7. remove apk index cache and disable coredup for sudo
  67. rm -rf /var/cache/apk/* && \
  68. echo "Set disable_coredump false" >> /etc/sudo.conf
  69. #8. expose port
  70. EXPOSE 2181 2888 3888 5432 5678 1234 12345 50051 8888
  71. ENTRYPOINT ["/sbin/tini", "--", "/root/startup.sh"]