Dockerfile 3.6 KB
Newer Older
B
bao liang 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

L
liwenhe1993 已提交
18 19 20 21 22 23 24 25
FROM nginx:alpine

ARG VERSION

ENV TZ Asia/Shanghai
ENV LANG C.UTF-8
ENV DEBIAN_FRONTEND noninteractive

26
#1. install dos2unix shadow bash openrc python sudo vim wget iputils net-tools ssh pip tini kazoo.
L
liwenhe1993 已提交
27 28 29
#If install slowly, you can replcae alpine's mirror with aliyun's mirror, Example:
#RUN sed -i "s/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g" /etc/apk/repositories
RUN apk update && \
30
    apk add dos2unix shadow bash openrc python sudo vim wget iputils net-tools openssh-server py2-pip tini && \
L
liwenhe1993 已提交
31 32 33 34 35 36 37
    apk add --update procps && \
    openrc boot && \
    pip install kazoo

#2. install jdk
RUN apk add openjdk8
ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk
38 39
ENV PATH $JAVA_HOME/bin:$PATH

L
liwenhe1993 已提交
40
#3. install zk
41
RUN cd /opt && \
L
liwenhe1993 已提交
42 43 44
    wget https://downloads.apache.org/zookeeper/zookeeper-3.5.7/apache-zookeeper-3.5.7-bin.tar.gz && \
    tar -zxvf apache-zookeeper-3.5.7-bin.tar.gz && \
    mv apache-zookeeper-3.5.7-bin zookeeper && \
45
    mkdir -p /tmp/zookeeper && \
L
liwenhe1993 已提交
46
    rm -rf ./zookeeper-*tar.gz && \
47
    rm -rf /opt/zookeeper/conf/zoo_sample.cfg
L
liwenhe1993 已提交
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
ADD ./conf/zookeeper/zoo.cfg /opt/zookeeper/conf
ENV ZK_HOME /opt/zookeeper
ENV PATH $ZK_HOME/bin:$PATH

#4. install pg
RUN apk add postgresql postgresql-contrib

#5. add dolphinscheduler
ADD ./apache-dolphinscheduler-incubating-${VERSION}-SNAPSHOT-dolphinscheduler-bin.tar.gz /opt/
RUN mv /opt/apache-dolphinscheduler-incubating-${VERSION}-SNAPSHOT-dolphinscheduler-bin/ /opt/dolphinscheduler/
ENV DOLPHINSCHEDULER_HOME /opt/dolphinscheduler

#6. modify nginx
RUN echo "daemon off;" >> /etc/nginx/nginx.conf && \
    rm -rf /etc/nginx/conf.d/*
ADD ./conf/nginx/dolphinscheduler.conf /etc/nginx/conf.d

#7. add configuration and modify permissions and set soft links
66
ADD ./checkpoint.sh /root/checkpoint.sh
L
liwenhe1993 已提交
67 68 69
ADD ./startup-init-conf.sh /root/startup-init-conf.sh
ADD ./startup.sh /root/startup.sh
ADD ./conf/dolphinscheduler/*.tpl /opt/dolphinscheduler/conf/
70 71 72
ADD conf/dolphinscheduler/env/dolphinscheduler_env.sh /opt/dolphinscheduler/conf/env/
RUN chmod +x /root/checkpoint.sh && \
    chmod +x /root/startup-init-conf.sh && \
L
liwenhe1993 已提交
73
    chmod +x /root/startup.sh && \
74
    chmod +x /opt/dolphinscheduler/conf/env/dolphinscheduler_env.sh && \
L
liwenhe1993 已提交
75 76 77
    chmod +x /opt/dolphinscheduler/script/*.sh && \
    chmod +x /opt/dolphinscheduler/bin/*.sh && \
    chmod +x /opt/zookeeper/bin/*.sh && \
78
    dos2unix /root/checkpoint.sh && \
L
liwenhe1993 已提交
79 80
    dos2unix /root/startup-init-conf.sh && \
    dos2unix /root/startup.sh && \
81
    dos2unix /opt/dolphinscheduler/conf/env/dolphinscheduler_env.sh && \
L
liwenhe1993 已提交
82 83 84 85 86 87 88 89 90 91 92
    dos2unix /opt/dolphinscheduler/script/*.sh && \
    dos2unix /opt/dolphinscheduler/bin/*.sh && \
    dos2unix /opt/zookeeper/bin/*.sh && \
    rm -rf /bin/sh && \
    ln -s /bin/bash /bin/sh && \
    mkdir -p /tmp/xls

#8. remove apk index cache
RUN rm -rf /var/cache/apk/*

#9. expose port
L
liwenhe1993 已提交
93
EXPOSE 2181 2888 3888 5432 5678 1234 12345 50051 8888
94

95
ENTRYPOINT ["/sbin/tini", "--", "/root/startup.sh"]