forked from agois-inc/js-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
99 lines (83 loc) · 4.5 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Copyright (c) 2020. TIBCO Software Inc.
# This file is subject to the license terms contained
# in the license file that is distributed with this file.
ARG TOMCAT_BASE_IMAGE=tomcat:9.0.35-jdk11-openjdk
FROM ${TOMCAT_BASE_IMAGE}
ARG DN_HOSTNAME
ARG KS_PASSWORD
ARG JRS_HTTPS_ONLY
ARG HTTP_PORT
ARG HTTPS_PORT
ARG POSTGRES_JDBC_DRIVER_VERSION
ARG JASPERREPORTS_SERVER_VERSION
ARG EXPLODED_INSTALLER_DIRECTORY
ENV PHANTOMJS_VERSION ${PHANTOMJS_VERSION:-2.1.1}
ENV DN_HOSTNAME ${DN_HOSTNAME:-localhost.localdomain}
ENV KS_PASSWORD ${KS_PASSWORD:-changeit}
ENV JRS_HTTPS_ONLY ${JRS_HTTPS_ONLY:-false}
ENV HTTP_PORT ${HTTP_PORT:-8080}
ENV HTTPS_PORT ${HTTPS_PORT:-8443}
ENV POSTGRES_JDBC_DRIVER_VERSION ${POSTGRES_JDBC_DRIVER_VERSION:-42.2.14}
ENV JASPERREPORTS_SERVER_VERSION ${JASPERREPORTS_SERVER_VERSION:-7.5.0}
ENV EXPLODED_INSTALLER_DIRECTORY ${EXPLODED_INSTALLER_DIRECTORY:-resources/jasperreports-server-cp-$JASPERREPORTS_SERVER_VERSION-bin}
# This Dockerfile requires an exploded JasperReports Server WAR file installer file
# EXPLODED_INSTALLER_DIRECTORY (default jasperreports-server-bin/) directory below the Dockerfile.
RUN mkdir -p /usr/src/jasperreports-server
# get the WAR and license
COPY ${EXPLODED_INSTALLER_DIRECTORY}/jasperserver $CATALINA_HOME/webapps/jasperserver/
COPY ${EXPLODED_INSTALLER_DIRECTORY}/TIB* /usr/src/jasperreports-server/
# Ant
COPY ${EXPLODED_INSTALLER_DIRECTORY}/apache-ant /usr/src/jasperreports-server/apache-ant/
# js-ant script, Ant XMLs and support in bin
COPY ${EXPLODED_INSTALLER_DIRECTORY}/buildomatic/js-ant /usr/src/jasperreports-server/buildomatic/
COPY ${EXPLODED_INSTALLER_DIRECTORY}/buildomatic/build.xml /usr/src/jasperreports-server/buildomatic/
COPY ${EXPLODED_INSTALLER_DIRECTORY}/buildomatic/bin/*.xml /usr/src/jasperreports-server/buildomatic/bin/
COPY ${EXPLODED_INSTALLER_DIRECTORY}/buildomatic/bin/app-server /usr/src/jasperreports-server/buildomatic/bin/app-server/
COPY ${EXPLODED_INSTALLER_DIRECTORY}/buildomatic/bin/groovy /usr/src/jasperreports-server/buildomatic/bin/groovy/
# supporting resources
COPY ${EXPLODED_INSTALLER_DIRECTORY}/buildomatic/conf_source /usr/src/jasperreports-server/buildomatic/conf_source/
COPY ${EXPLODED_INSTALLER_DIRECTORY}/buildomatic/target /usr/src/jasperreports-server/buildomatic/target/
COPY scripts /
# Copy Fonts Extension lib
COPY assets/libs $CATALINA_HOME/webapps/jasperserver/WEB-INF/lib/
# Copy JDBC Driver
COPY resources/postgresql-${POSTGRES_JDBC_DRIVER_VERSION}.jar /usr/src/jasperreports-server/buildomatic/conf_source/db/postgresql/jdbc/
RUN echo "nameserver 8.8.8.8" | tee /etc/resolv.conf > /dev/null && \
chmod +x /*.sh && \
/installPackagesForJasperserver-ce.sh > /dev/null && \
echo "finished installing packages" && \
rm -rf $CATALINA_HOME/webapps/ROOT && \
rm -rf $CATALINA_HOME/webapps/docs && \
rm -rf $CATALINA_HOME/webapps/examples && \
rm -rf $CATALINA_HOME/webapps/host-manager && \
rm -rf $CATALINA_HOME/webapps/manager && \
cp -R /buildomatic /usr/src/jasperreports-server/buildomatic && \
rm /installPackagesForJasperserver*.sh && rm -rf /buildomatic && \
chmod +x /usr/src/jasperreports-server/buildomatic/js-* && \
chmod +x /usr/src/jasperreports-server/apache-ant/bin/* && \
java -version && \
keytool -genkey -alias self_signed -dname "CN=${DN_HOSTNAME}" \
-storetype PKCS12 \
-storepass "${KS_PASSWORD}" \
-keypass "${KS_PASSWORD}" \
-keystore /root/.keystore.p12 && \
keytool -list -keystore /root/.keystore.p12 -storepass "${KS_PASSWORD}" -storetype PKCS12 && \
xmlstarlet ed --inplace --subnode "/Server/Service" --type elem \
-n Connector -v "" --var connector-ssl '$prev' \
--insert '$connector-ssl' --type attr -n port -v "${HTTPS_PORT}" \
--insert '$connector-ssl' --type attr -n protocol -v \
"org.apache.coyote.http11.Http11NioProtocol" \
--insert '$connector-ssl' --type attr -n maxThreads -v "150" \
--insert '$connector-ssl' --type attr -n SSLEnabled -v "true" \
--insert '$connector-ssl' --type attr -n scheme -v "https" \
--insert '$connector-ssl' --type attr -n secure -v "true" \
--insert '$connector-ssl' --type attr -n clientAuth -v "false" \
--insert '$connector-ssl' --type attr -n sslProtocol -v "TLS" \
--insert '$connector-ssl' --type attr -n keystorePass \
-v "${KS_PASSWORD}" \
--insert '$connector-ssl' --type attr -n keystoreFile \
-v "/root/.keystore.p12" \
${CATALINA_HOME}/conf/server.xml
EXPOSE ${HTTP_PORT} ${HTTPS_PORT}
# ENTRYPOINT ["/entrypoint-ce.sh"]
CMD ["run"]