Add HOSTNAME to the Dockerfile
[holmes/dsa.git] / dmaap-dsa-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 ENV HOSTNAME holmes-dsa
25
26 RUN set -x \
27     && apk add --no-cache \
28         openjdk8="$JAVA_ALPINE_VERSION" \
29     && [ "$JAVA_HOME" = "$(docker-java-home)" ]
30
31 #add holmes related resources to the docker image
32
33 RUN mkdir /home/holmes
34
35 WORKDIR /home/holmes
36
37 ADD holmes-dmaap-dsa-standalone-*-linux64.tar.gz /home/holmes/
38
39 RUN chmod 755 /home/holmes/bin/*.sh
40
41
42 ENTRYPOINT /home/holmes/bin/run.sh
43
44