-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
35 lines (28 loc) · 1.06 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#
# CDRGenerator Alpine Docker Container
#
FROM alpine:3.4
# Default to UTF-8 file.encoding
ENV LANG C.UTF-8
# add a simple script that can auto-detect the appropriate JAVA_HOME value
# based on whether the JDK or only the JRE is installed
RUN { echo '#!/bin/sh'; \
echo 'set -e'; \
echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; \
} > /usr/local/bin/docker-java-home \
&& chmod +x /usr/local/bin/docker-java-home
ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk/jre
ENV PATH $PATH:/usr/lib/jvm/java-1.8-openjdk/jre/bin:/usr/lib/jvm/java-1.8-openjdk/bin
ENV JAVA_VERSION 8u111
ENV JAVA_ALPINE_VERSION 8.111.14-r0
# Add bash
RUN apk update
RUN apk add bash
RUN set -x \
&& apk add --no-cache \
openjdk8-jre="$JAVA_ALPINE_VERSION" \
&& [ "$JAVA_HOME" = "$(docker-java-home)" ]
# Copy and run CDRGenerator.jar
COPY target/scala-2.11/CDRGenerator.jar /home/CDRGenerator.jar
COPY src/main/resources/ /home/
CMD ["java","-Dnetty.epoll.enabled=false","-Dconfig.file=/home/application.conf","-Dtrends.dir=/home/trends/","-jar","/home/CDRGenerator.jar"]