b5f1c2d7904f22e4eee831a9649281ae1ec2fb3c
[holmes/engine-management.git] / engine-d-standalone / src / main / assembly / Dockerfile
1 FROM openresty/openresty:alpine
2
3 MAINTAINER "Guangrong Fu" <fu.guangrong@zte.com.cn>
4
5 EXPOSE 9102 9202 8312
6
7 ENV HOSTNAME holmes-engine-mgmt
8
9 ENV LANG C.UTF-8
10
11 #install java-1.8-openjdk
12
13 # add a simple script that can auto-detect the appropriate JAVA_HOME value
14 # based on whether the JDK or only the JRE is installed
15 RUN { \
16                 echo '#!/bin/sh'; \
17                 echo 'set -e'; \
18                 echo; \
19                 echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; \
20         } > /usr/local/bin/docker-java-home \
21         && chmod +x /usr/local/bin/docker-java-home
22 ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk
23 ENV PATH $PATH:/usr/lib/jvm/java-1.8-openjdk/jre/bin:/usr/lib/jvm/java-1.8-openjdk/bin
24
25 ENV JAVA_ALPINE_VERSION 8.171.11-r0
26
27 RUN set -x \
28         && apk add --no-cache \
29                 openjdk8="$JAVA_ALPINE_VERSION" \
30         && [ "$JAVA_HOME" = "$(docker-java-home)" ]
31
32 #install neccessary tools
33 RUN apk upgrade \
34     && apk update \
35     && apk add --no-cache curl \
36     && apk add --no-cache wget \
37     && apk add --no-cache postgresql-client=10.4-r0
38
39 #install ActiveMQ
40 RUN mkdir /home/downloads
41 RUN mkdir /home/activemq
42 RUN cd /home/downloads
43 RUN wget http://archive.apache.org/dist/activemq/apache-activemq/5.9.0/apache-activemq-5.9.0-bin.tar.gz
44 RUN tar -xzvf apache-activemq-5.9.0-bin.tar.gz -C /home/activemq/
45 RUN rm -rf /home/downloads
46
47 #add the backend package to the docker image
48 RUN mkdir /home/holmes
49 WORKDIR /home/holmes
50 ADD holmes-engine-d-standalone-*-linux64.tar.gz /home/holmes/
51 RUN chmod 755 /home/holmes/bin/*.sh
52
53 CMD ["sh", "/home/holmes/bin/run.sh"]
54
55
56
57