Skip to content

Commit

Permalink
Merge pull request #48 from TIBCOSoftware/JS-59819-Fix
Browse files Browse the repository at this point in the history
JS-59819 : Fix the .env and Dockerfiles
  • Loading branch information
grantbacon-jaspersoft authored Oct 14, 2020
2 parents c086378 + a367dd2 commit 6c75b03
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 25 deletions.
10 changes: 8 additions & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,17 @@
#JASPERREPORTS_SERVER_VERSION=7.2.0
#JASPERREPORTS_SERVER_IMAGE_TAG=7.2.0

# 7.5 - Docker Hub. Debian based
# 7.5.0 - Docker Hub. Debian based
# JAVA_BASE_IMAGE=openjdk:11.0-slim
# TOMCAT_BASE_IMAGE=tomcat:9.0.31-jdk11-openjdk
# JASPERREPORTS_SERVER_VERSION=7.5.0
# JASPERREPORTS_SERVER_IMAGE_TAG=7.5.0

# 7.5.1 - Docker Hub. Debian based
JAVA_BASE_IMAGE=openjdk:11.0-slim
TOMCAT_BASE_IMAGE=tomcat:9.0.31-jdk11-openjdk
JASPERREPORTS_SERVER_VERSION=7.5.0
JASPERREPORTS_SERVER_IMAGE_TAG=7.5.0
JASPERREPORTS_SERVER_IMAGE_TAG=7.5.1

# Amazon Corretto works
#JAVA_BASE_IMAGE=amazoncorretto:11
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ 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.5}
ENV JASPERREPORTS_SERVER_VERSION ${JASPERREPORTS_SERVER_VERSION:-7.5.0}
ENV JASPERREPORTS_SERVER_VERSION ${JASPERREPORTS_SERVER_VERSION:-7.5.1}
ENV EXPLODED_INSTALLER_DIRECTORY ${EXPLODED_INSTALLER_DIRECTORY:-resources/jasperreports-server-pro-$JASPERREPORTS_SERVER_VERSION-bin}

# This Dockerfile requires an exploded JasperReports Server WAR file installer file
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile-cmdline
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ARG JASPERREPORTS_SERVER_VERSION
ARG EXPLODED_INSTALLER_DIRECTORY

ENV POSTGRES_JDBC_DRIVER_VERSION ${POSTGRES_JDBC_DRIVER_VERSION:-42.2.5}
ENV JASPERREPORTS_SERVER_VERSION ${JASPERREPORTS_SERVER_VERSION:-7.5.0}
ENV JASPERREPORTS_SERVER_VERSION ${JASPERREPORTS_SERVER_VERSION:-7.5.1}
ENV EXPLODED_INSTALLER_DIRECTORY ${EXPLODED_INSTALLER_DIRECTORY:-resources/jasperreports-server-pro-$JASPERREPORTS_SERVER_VERSION-bin}

# This Dockerfile requires an exploded JasperReports Server WAR file installer file
Expand Down
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,11 @@ For the JasperReports Server Web app (WAR):

| Environment Variable Name | Notes |
| ------------ | ------------- |
| `TOMCAT_BASE_IMAGE` | Tomcat Docker image certified for the version of JasperReports Server being deployed. Linux images using apt-get (Debian) or yum (CentOS, Redhat, Corretto/Amazon Linux 2) package managers. Default for 7.5: "tomcat:9.0.31-jdk11-openjdk". |
| `JASPERREPORTS_SERVER_VERSION` | Version number used in file names. Default for JasperReports Server: 7.5.0 |
| `TOMCAT_BASE_IMAGE` | Tomcat Docker image certified for the version of JasperReports Server being deployed. Linux images using apt-get (Debian) or yum (CentOS, Redhat, Corretto/Amazon Linux 2) package managers. Default for 7.5.1: "tomcat:9.0.31-jdk11-openjdk". |
| `JASPERREPORTS_SERVER_VERSION` | Version number used in file names. Default for JasperReports Server: 7.5.1 |
| `EXPLODED_INSTALLER_DIRECTORY` | Directory below the Dockerfiles where the WAR file installer has been prepared as above. Default: resources/jasperreports-server-pro-$JASPERREPORTS_SERVER_VERSION-bin
| `HTTP_PORT` | HTTP port Tomcat runs on. Default: "8080" |
| `HTTPS_PORT` | HTTPS port Tomcat runs on. Default: "8443" |
| `HTTP_PORT` | HTTP port Tomcat runs on and .env file should be updated wih correct port number if any non default port is used. Default: "8080" |
| `HTTPS_PORT` | HTTPS port Tomcat runs on and .env file should be updated wih correct port number if any non default port is used. Default: "8443" |
| `JRS_HTTPS_ONLY` | Enables HTTPS-only mode. Default: false. |
| | A self signed SSL certificate is defined for Tomcat. |
|`DN_HOSTNAME` | Self signed certificate host name. Default: "localhost.localdomain" |
Expand All @@ -166,15 +166,15 @@ For the cmdline:
| Environment Variable Name | Notes |
| ------------ | ------------- |
| `JAVA_BASE_IMAGE` | Java Docker image certified for the version of JasperReports Server being deployed. Linux images using apt-get (Debian) or yum (CentOS, Redhat, Corretto/Amazon Linux 2) package managers. JDK 8 or 11 from https://github.com/docker-library/docs/blob/master/openjdk/README.md#supported-tags-and-respective-dockerfile-links Default openjdk:11.0-slim |
| `JASPERREPORTS_SERVER_VERSION` | Version number used in file names. Default: 7.5.0 |
| `JASPERREPORTS_SERVER_VERSION` | Version number used in file names. Default: 7.5.1 |
| `EXPLODED_INSTALLER_DIRECTORY` | Directory below the Dockerfiles where the WAR file installer has been prepared as above. Default: resources/jasperreports-server-pro-$JASPERREPORTS_SERVER_VERSION-bin
|`POSTGRES_JDBC_DRIVER_VERSION` | Default: 42.2.5. If you change this, the new version will be downloaded from https://jdbc.postgresql.org/download.html |

### Build the images

`docker build -t jasperserver-pro:7.5.0 .`
`docker build -t jasperserver-pro:7.5.1 .`

`docker build -t jasperserver-pro-cmdline:7.5.0 -f Dockerfile-cmdline .`
`docker build -t jasperserver-pro-cmdline:7.5.1 -f Dockerfile-cmdline .`

# docker run time environment variables

Expand All @@ -192,8 +192,8 @@ This image does not create the repository and keystore files. See cmdline below.
| `DB_USER` | database username. Default: postgres |
| `DB_PASSWORD` | database password. Default: postgres |
| `DB_NAME` | JasperReports Server repository schema name in the database. Default: "jasperserver" |
| `HTTP_PORT` | HTTP port Tomcat runs on. Default: HTTP_PORT in image |
| `HTTPS_PORT` | HTTPS port Tomcat runs on. Default: HTTPS_PORT in image |
| `HTTP_PORT` | HTTP port Tomcat runs on and .env file should be updated wih correct port number if any non default port is used. Default: HTTP_PORT in image |
| `HTTPS_PORT` | HTTPS port Tomcat runs on and .env file should be updated wih correct port number if any non default port is used. Default: HTTPS_PORT in image |
| `JAVA_OPTS` | Command line options passed to Java. Optional. The Java heap size of JasperReports Server is automatically managed to conform to the container size. |
| `JAVA_MIN_RAM_PERCENTAGE` | Java heap minimum percentage in the container. Default: 33.3% |
| `JAVA_MAX_RAM_PERCENTAGE` | Java heap maximum percentage in the container. Default: 80.0% |
Expand Down Expand Up @@ -243,19 +243,21 @@ For the JasperReports Server Web app (WAR):
| Description | Path to override in container | Notes |
| ------------ | ------------- | ------------ |
| License | `/usr/local/share/jasperserver-pro/license` | REQUIRED. Path to contain `jasperserver.license` file to use. |
| Encryption keystore files | `/usr/local/share/jasperserver-pro/keystore` | REQUIRED. .jrsks and .jrsksp files used to encrypt sensitive values. This volume is required for use with JRS 7.5, which will create these files on this volume if they do not exist when initializing the repository database. |
| Encryption keystore files | `/usr/local/share/jasperserver-pro/keystore` | REQUIRED. .jrsks and .jrsksp files used to encrypt sensitive values. This volume is required for use with JRS 7.5.1, which will create these files on this volume if they do not exist when initializing the repository database. |
| JasperReports Server customizations | `/usr/local/share/jasperserver-pro/customization` | Zip files. If a zip file contains `install.sh`, it will be unzipped and executed - useful for hotfixes or config changes in the image. Zip files that do not contain `install.sh` will be unzipped into `${CATALINA_HOME}/webapps/jasperserver-pro`. Files are processed in alphabetical order, so duplicate file names within zips can be overridden. |
| Tomcat level customizations | `/usr/local/share/jasperserver-pro/tomcat-customization` | Zip files that are unzipped into `${CATALINA_HOME}`. Files are processed in alphabetical order, so duplicate file names within zips can be overridden. |
| SSL keystore file | `/usr/local/share/jasperserver-pro/ssl-certificate` | .keystore file containing the certificate in this volume will be loaded into /root and Tomcat updated to use it. The keystore password must be set as the KS_PASSWORD environment variable. |
| Additional default_master installation properties | `/usr/local/share/jasperserver-pro/deploy-customization` | `default_master_additional.properties` file contents appended to default_master.properties. See "To install the WAR file using js-install scripts" in JasperReports Server Installation Guide |
| JDBC driver for the repository database | /usr/src/jasperreports-server/buildomatic/conf_source/db/dbType/jdbc | Override JDBC drivers within the image for the repository. Valid dbTypes are: postgresql, mysql, sqlserver, oracle, db2. Need to set the `JDBC_DRIVER_VERSION` environment variable to the version number of the driver. |
Note: Tomcat and JasperReports server customizations are applied after deploying the JasperReports Server Application in tomcat.


For the cmdline:

| Description | Path to override in container | Notes |
| ------------ | ------------- | ------------ |
| License | `/usr/local/share/jasperserver-pro/license` | REQUIRED. Path to contain `jasperserver.license` file to use. |
| Encryption keystore files | `/usr/local/share/jasperserver-pro/keystore` | REQUIRED. .jrsks and .jrsksp files used to encrypt sensitive values. This volume is required for use with JRS 7.5, which will create these files on this volume if they do not exist when initializing the database. |
| Encryption keystore files | `/usr/local/share/jasperserver-pro/keystore` | REQUIRED. .jrsks and .jrsksp files used to encrypt sensitive values. This volume is required for use with JRS 7.5.1, which will create these files on this volume if they do not exist when initializing the database. |
| Additional default_master installation properties | `/usr/local/share/jasperserver-pro/deploy-customization` | `default_master_additional.properties` file contents appended to default_master.properties. See "To install the WAR file using js-install scripts" in JasperReports Server Installation Guide |
| JDBC driver for the repository database | /usr/src/jasperreports-server/buildomatic/conf_source/db/<dbType>/jdbc | Override JDBC drivers within the image for the repository. Valid dbTypes are: postgresql, mysql, sqlserver, oracle, db2. Need to set the `JDBC_DRIVER_VERSION` environment variable to the version number of the driver. |
| Buildomatic customizations | `/usr/local/share/jasperserver-pro/buildomatic_customization` | Zip files. If a zip file contains `install.sh`, it will be unzipped and executed - useful for hotfixes or config changes in the image. Zip files that do not contain `install.sh` will be unzipped into `${BUILDOMATIC_HOME}`. Files are processed in alphabetical order, so duplicate file names within zips can be overridden. |
Expand Down
4 changes: 2 additions & 2 deletions platforms/aws/Dockerfile-cmdline-s3
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
# JasperReports Server command line image, loading resources from S3.
# Leverages base JRS image of same version

ARG JASPERREPORTS_SERVER_VERSION=7.5.0
ARG JASPERREPORTS_SERVER_VERSION=7.5.1

FROM jasperserver-pro-cmdline:${JASPERREPORTS_SERVER_VERSION}

ENV JASPERREPORTS_SERVER_VERSION ${JASPERREPORTS_SERVER_VERSION:-7.5.0}
ENV JASPERREPORTS_SERVER_VERSION ${JASPERREPORTS_SERVER_VERSION:-7.5.1}

COPY scripts /

Expand Down
4 changes: 2 additions & 2 deletions platforms/aws/Dockerfile-s3
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
# JasperReports Server image loading resources from S3.
# Leverages base JRS image of same version

ARG JASPERREPORTS_SERVER_VERSION=7.5.0
ARG JASPERREPORTS_SERVER_VERSION=7.5.1

FROM jasperserver-pro:${JASPERREPORTS_SERVER_VERSION}

ENV JASPERREPORTS_SERVER_VERSION ${JASPERREPORTS_SERVER_VERSION:-7.5.0}
ENV JASPERREPORTS_SERVER_VERSION ${JASPERREPORTS_SERVER_VERSION:-7.5.1}

COPY scripts /

Expand Down
7 changes: 4 additions & 3 deletions platforms/aws/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,12 @@ The following software is required or recommended:
The CloudFormation templates attached here:
- jasperreports-server-7.2.0-ecr.template
- jasperreports-server-7.5.0-ecr.template
- jasperreports-server-7.5.1-ecr.template

create the JasperReports Server images:
- jasperserver-pro:<version>
- jasperserver-pro-cmdline:<version>
- jasperserver-pro-cmdline:<version>-k8s
- jasperserver-pro:<jrs_version>
- jasperserver-pro-cmdline:<jrs_version>
- jasperserver-pro-cmdline:<jrs_version>-k8s

To create these stacks, you need to go to the AWS Marketplace and subscribe to TIBCO Jaspersoft Reporting and Analytics (BYOL).
- Find via the listings via: https://aws.amazon.com/marketplace/search/results?x=0&y=0&searchTerms=jaspersoft+byol
Expand Down
7 changes: 4 additions & 3 deletions scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ set -e

run_jasperserver() {

# Apply customization zips if present
apply_customizations

test_database_connection

Expand All @@ -25,6 +23,9 @@ run_jasperserver() {

execute_buildomatic deploy-webapp-pro

# Apply customization zips if present
apply_customizations

# setup phantomjs
config_phantomjs

Expand Down Expand Up @@ -89,7 +90,7 @@ config_ports_and_ssl() {
-exec readlink -f {} \;`

# update the keystore and password if there
if [[ $CERT_PATH_FILES -ne 0 ]]; then
if [[ ${#CERT_PATH_FILES} -ne 0 ]]; then
# will only be one, if at all
for keystore in $CERT_PATH_FILES; do
if [[ -f "$keystore" ]]; then
Expand Down

0 comments on commit 6c75b03

Please sign in to comment.