Dockerfile 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. FROM ubuntu:18.04
  2. ENV LANG=C.UTF-8
  3. ENV DEBIAN_FRONTEND=noninteractive
  4. ARG version
  5. ARG tar_version
  6. #1,install jdk
  7. RUN apt-get update \
  8. && apt-get -y install openjdk-8-jdk \
  9. && rm -rf /var/lib/apt/lists/*
  10. ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
  11. ENV PATH $JAVA_HOME/bin:$PATH
  12. #install wget
  13. RUN apt-get update && \
  14. apt-get -y install wget
  15. #2,install ZK
  16. RUN cd /opt && \
  17. wget https://www-us.apache.org/dist/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz && \
  18. tar -zxvf zookeeper-3.4.14.tar.gz && \
  19. mv zookeeper-3.4.14 zookeeper && \
  20. rm -rf ./zookeeper-*tar.gz && \
  21. mkdir -p /tmp/zookeeper && \
  22. rm -rf /opt/zookeeper/conf/zoo_sample.cfg
  23. ADD ./dockerfile/conf/zookeeper/zoo.cfg /opt/zookeeper/conf
  24. ENV ZK_HOME=/opt/zookeeper
  25. ENV PATH $PATH:$ZK_HOME/bin
  26. #3,install maven
  27. RUN cd /opt && \
  28. wget http://apache-mirror.rbc.ru/pub/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz && \
  29. tar -zxvf apache-maven-3.3.9-bin.tar.gz && \
  30. mv apache-maven-3.3.9 maven && \
  31. rm -rf ./apache-maven-*tar.gz && \
  32. rm -rf /opt/maven/conf/settings.xml
  33. ADD ./dockerfile/conf/maven/settings.xml /opt/maven/conf
  34. ENV MAVEN_HOME=/opt/maven
  35. ENV PATH $PATH:$MAVEN_HOME/bin
  36. #4,install node
  37. RUN cd /opt && \
  38. wget https://nodejs.org/download/release/v8.9.4/node-v8.9.4-linux-x64.tar.gz && \
  39. tar -zxvf node-v8.9.4-linux-x64.tar.gz && \
  40. mv node-v8.9.4-linux-x64 node && \
  41. rm -rf ./node-v8.9.4-*tar.gz
  42. ENV NODE_HOME=/opt/node
  43. ENV PATH $PATH:$NODE_HOME/bin
  44. #5,install postgresql
  45. RUN apt-get update && \
  46. apt-get install -y postgresql postgresql-contrib sudo && \
  47. sed -i 's/localhost/*/g' /etc/postgresql/10/main/postgresql.conf
  48. #6,install nginx
  49. RUN apt-get update && \
  50. apt-get install -y nginx && \
  51. rm -rf /var/lib/apt/lists/* && \
  52. echo "\ndaemon off;" >> /etc/nginx/nginx.conf && \
  53. chown -R www-data:www-data /var/lib/nginx
  54. #7,install sudo,python,vim,ping and ssh command
  55. RUN apt-get update && \
  56. apt-get -y install sudo && \
  57. apt-get -y install python && \
  58. apt-get -y install vim && \
  59. apt-get -y install iputils-ping && \
  60. apt-get -y install net-tools && \
  61. apt-get -y install openssh-server && \
  62. apt-get -y install python-pip && \
  63. pip install kazoo
  64. #8,add dolphinscheduler source code to /opt/dolphinscheduler_source
  65. ADD . /opt/dolphinscheduler_source
  66. #9,backend compilation
  67. RUN cd /opt/dolphinscheduler_source && \
  68. mvn -U clean package assembly:assembly -Dmaven.test.skip=true
  69. #10,frontend compilation
  70. RUN chmod -R 777 /opt/dolphinscheduler_source/dolphinscheduler-ui && \
  71. cd /opt/dolphinscheduler_source/dolphinscheduler-ui && \
  72. rm -rf /opt/dolphinscheduler_source/dolphinscheduler-ui/node_modules && \
  73. npm install node-sass --unsafe-perm && \
  74. npm install && \
  75. npm run build
  76. #11,modify dolphinscheduler configuration file
  77. #backend configuration
  78. RUN mkdir -p /opt/dolphinscheduler && \
  79. tar -zxvf /opt/dolphinscheduler_source/target/dolphinscheduler-${tar_version}.tar.gz -C /opt/dolphinscheduler && \
  80. rm -rf /opt/dolphinscheduler/conf
  81. ADD ./dockerfile/conf/dolphinscheduler/conf /opt/dolphinscheduler/conf
  82. #frontend nginx configuration
  83. ADD ./dockerfile/conf/nginx/dolphinscheduler.conf /etc/nginx/conf.d
  84. #12,open port
  85. EXPOSE 2181 2888 3888 3306 80 12345 8888
  86. COPY ./dockerfile/startup.sh /root/startup.sh
  87. #13,modify permissions and set soft links
  88. RUN chmod +x /root/startup.sh && \
  89. chmod +x /opt/dolphinscheduler/script/create-dolphinscheduler.sh && \
  90. chmod +x /opt/zookeeper/bin/zkServer.sh && \
  91. chmod +x /opt/dolphinscheduler/bin/dolphinscheduler-daemon.sh && \
  92. rm -rf /bin/sh && \
  93. ln -s /bin/bash /bin/sh && \
  94. mkdir -p /tmp/xls
  95. ENTRYPOINT ["/root/startup.sh"]