1 FROM openresty/openresty:alpine
3 MAINTAINER "Guangrong Fu" <fu.guangrong@zte.com.cn>
7 ENV HOSTNAME=holmes-engine-mgmt \
9 JAVA_HOME=/usr/lib/jvm/java-1.8-openjdk \
10 PATH=$PATH:/usr/lib/jvm/java-1.8-openjdk/jre/bin:/usr/lib/jvm/java-1.8-openjdk/bin \
11 JAVA_ALPINE_VERSION=8.242.08-r0 \
14 #add the backend package to the docker image
16 ADD holmes-engine-d-standalone-*-linux64.tar.gz /home/holmes/
18 # add a simple script that can auto-detect the appropriate JAVA_HOME value
19 # based on whether the JDK or only the JRE is installed
24 echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; \
25 } > /usr/local/bin/docker-java-home \
26 && chmod +x /usr/local/bin/docker-java-home \
28 #install java-1.8-openjdk
29 && apk add --no-cache openjdk8="$JAVA_ALPINE_VERSION" \
30 && [ "$JAVA_HOME" = "$(docker-java-home)" ] \
31 #install neccessary tools
34 && apk add --no-cache curl \
35 && apk add --no-cache wget \
36 && apk add --no-cache postgresql-client="$PG_VERSION" \
37 && apk add --no-cache nss \
39 #switch the user to holmes
40 && addgroup -S holmes && adduser -S -G holmes holmes \
42 && chmod -R a+rw /home/holmes/ \
43 && chmod -R a+rw /var/log/ \
44 && chmod 755 /home/holmes/bin/*.sh
48 CMD ["sh", "/home/holmes/bin/run.sh"]