Add ActiveMQ to the Docker Image
[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 #install java-1.8-openjdk
6
7 ENV LANG C.UTF-8
8
9 # add a simple script that can auto-detect the appropriate JAVA_HOME value
10 # based on whether the JDK or only the JRE is installed
11 RUN { \
12         echo '#!/bin/sh'; \
13         echo 'set -e'; \
14         echo; \
15         echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; \
16     } > /usr/local/bin/docker-java-home \
17     && chmod +x /usr/local/bin/docker-java-home
18 ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk
19 ENV PATH $PATH:/usr/lib/jvm/java-1.8-openjdk/jre/bin:/usr/lib/jvm/java-1.8-openjdk/bin
20
21 ENV JAVA_VERSION 8u131
22 ENV JAVA_ALPINE_VERSION 8.131.11-r2
23
24 RUN set -x \
25     && apk add --no-cache \
26         openjdk8="$JAVA_ALPINE_VERSION" \
27     && [ "$JAVA_HOME" = "$(docker-java-home)" ]
28
29
30 #add activemq to the docker image
31 RUN mkdir /home/downloads
32 RUN mkdir /home/activemq
33 RUN cd /home/downloads
34 RUN apt-get update
35 RUN apt-get install -y wget
36 RUN wget http://archive.apache.org/dist/activemq/apache-activemq/5.9.0/apache-activemq-5.9.0-bin.tar.gz
37 RUN tar -xzvf apache-activemq-5.9.0-bin.tar.gz -C /home/activemq/
38 RUN rm -rf /home/downloads
39
40 #add holmes related resources to the docker image
41 RUN mkdir /home/holmes
42 WORKDIR /home/holmes
43 ADD holmes-engine-d-standalone-*-linux64.tar.gz /home/holmes/
44
45 RUN chmod 755 /home/holmes/bin/*.sh
46
47 ENTRYPOINT /home/holmes/bin/run.sh