bitnami/jasperreports
🛑 DEPRECATED Bitnami Docker Image for JasperReports
10M+
The JasperReports container is no longer maintained upstream and is now deprecated. This image will no longer be released in our catalog, but already released container images will persist in the registries.
After some months, this repository will be removed in favor of bitnami/jasperreports-archived where all existing images can be found.
JasperReports Server is a stand-alone and embeddable reporting server. It is a central information hub, with reporting and analytics that can be embedded into web and mobile applications.
Overview of JasperReports Trademarks: This software listing is packaged by Bitnami. The respective trademarks mentioned in the offering are owned by the respective companies, and use of them does not imply any affiliation or endorsement.
docker run --name jasperreports bitnami/jasperreports:latest
Warning: This quick setup is only intended for development environments. You are encouraged to change the insecure default credentials and check out the available configuration options in the Environment Variables section for a more secure deployment.
DOCKER_CONTENT_TRUST=1
to verify the integrity of the images.Looking to use JasperReports in production? Try VMware Tanzu Application Catalog, the enterprise edition of Bitnami Application Catalog.
Deploying Bitnami applications as Helm Charts is the easiest way to get started with our applications on Kubernetes. Read more about the installation in the Bitnami JasperReports Chart GitHub repository.
Bitnami containers can be used with Kubeapps for deployment and management of Helm Charts in clusters.
Non-root container images add an extra layer of security and are generally recommended for production environments. However, because they run as a non-root user, privileged tasks are typically off-limits. Learn more about non-root containers in our docs.
Dockerfile
linksLearn more about the Bitnami tagging policy and the difference between rolling tags and immutable tags in our documentation page.
You can see the equivalence between the different tags by taking a look at the tags-info.yaml
file present in the branch folder, i.e bitnami/ASSET/BRANCH/DISTRO/tags-info.yaml
.
Subscribe to project updates by watching the bitnami/containers GitHub repo.
The recommended way to get the Bitnami JasperReports Docker Image is to pull the prebuilt image from the Docker Hub Registry.
docker pull bitnami/jasperreports:latest
To use a specific version, you can pull a versioned tag. You can view the list of available versions in the Docker Hub Registry.
docker pull bitnami/jasperreports:[TAG]
If you wish, you can also build the image yourself by cloning the repository, changing to the directory containing the Dockerfile and executing the docker build
command. Remember to replace the APP
, VERSION
and OPERATING-SYSTEM
path placeholders in the example command below with the correct values.
git clone https://github.com/bitnami/containers.git
cd bitnami/APP/VERSION/OPERATING-SYSTEM
docker build -t bitnami/APP:latest .
JasperReports requires access to a MySQL or MariaDB database to store information. We'll use the Bitnami Docker Image for MariaDB for the database requirements.
...
jasperreports:
image: docker.io/bitnami/jasperreports:latest
ports:
- '80:8080'
volumes:
- 'jasperreports_data:/bitnami/jasperreports'
# The line below allows you to provide your own JasperReports configuration files, to be copied to WEB-INF
# - "./config:/bitnami/jasperreports-mounted-conf"
depends_on:
- mariadb
environment:
# ALLOW_EMPTY_PASSWORD is recommended only for development.
- ALLOW_EMPTY_PASSWORD=yes
- JASPERREPORTS_DATABASE_HOST=mariadb
- JASPERREPORTS_DATABASE_PORT_NUMBER=3306
- JASPERREPORTS_DATABASE_USER=bn_jasperreports
- JASPERREPORTS_DATABASE_NAME=bitnami_jasperreports
Step 1: Create a network
docker network create jasperreports-network
Step 2: Create a volume for MariaDB persistence and create a MariaDB container
$ docker volume create --name mariadb_data
docker run -d --name mariadb \
--env ALLOW_EMPTY_PASSWORD=yes \
--env MARIADB_USER=bn_jasperreports \
--env MARIADB_PASSWORD=bitnami \
--env MARIADB_DATABASE=bitnami_jasperreports \
--network jasperreports-network \
--volume mariadb_data:/bitnami/mariadb \
bitnami/mariadb:latest
Step 3: Create volumes for JasperReports persistence and launch the container
$ docker volume create --name jasperreports_data
docker run -d --name jasperreports \
-p 8080:8080 -p 8443:8443 \
--env JASPERREPORTS_DATABASE_USER=bn_jasperreports \
--env JASPERREPORTS_DATABASE_PASSWORD=bitnami \
--env JASPERREPORTS_DATABASE_NAME=bitnami_jasperreports \
--network jasperreports-network \
--volume jasperreports_data:/bitnami/jasperreports \
bitnami/jasperreports:latest
Access your application at http://your-ip/
curl -sSL https://raw.githubusercontent.com/bitnami/containers/main/bitnami/jasperreports/docker-compose.yml > docker-compose.yml
docker-compose up -d
Please be aware this file has not undergone internal testing. Consequently, we advise its use exclusively for development or testing purposes. For production-ready deployments, we highly recommend utilizing its associated Bitnami Helm chart.
If you detect any issue in the docker-compose.yaml
file, feel free to report it or contribute with a fix by following our Contributing Guidelines.
If you remove the container all your data will be lost, and the next time you run the image the database will be reinitialized. To avoid this loss of data, you should mount a volume that will persist even after the container is removed.
For persistence, you should mount a directory at the /bitnami/jasperreports
path. If the mounted directory is empty, it will be initialized on the first run. Additionally you should mount a volume for persistence of the MariaDB data.
The above examples define the Docker volumes named mariadb_data
and jasperreports_data
. The JasperReports application state will persist as long as volumes are not removed.
To avoid inadvertent removal of volumes, you can mount host directories as data volumes. Alternatively you can make use of volume plugins to host the volume data.
This requires a minor change to the docker-compose.yml
file present in this repository:
mariadb:
...
volumes:
- - 'mariadb_data:/bitnami/mariadb'
+ - /path/to/mariadb-persistence:/bitnami/mariadb
...
jasperreports:
...
volumes:
- - 'jasperreports_data:/bitnami/jasperreports'
+ - /path/to/jasperreports-persistence:/bitnami/jasperreports
...
-volumes:
- mariadb_data:
- driver: local
- jasperreports_data:
- driver: local
NOTE: As this is a non-root container, the mounted files and directories must have the proper permissions for the UID
1001
.
Step 1: Create a network (if it does not exist)
docker network create jasperreports-network
Step 2. Create a MariaDB container with host volume
docker run -d --name mariadb \
--env ALLOW_EMPTY_PASSWORD=yes \
--env MARIADB_USER=bn_jasperreports \
--env MARIADB_PASSWORD=bitnami \
--env MARIADB_DATABASE=bitnami_jasperreports \
--network jasperreports-network \
--volume /path/to/mariadb-persistence:/bitnami/mariadb \
bitnami/mariadb:latest
Step 3. Create the JasperReports container with host volumes
docker run -d --name jasperreports \
-p 8080:8080 -p 8443:8443 \
--env JASPERREPORTS_DATABASE_USER=bn_jasperreports \
--env JASPERREPORTS_DATABASE_PASSWORD=bitnami \
--env JASPERREPORTS_DATABASE_NAME=bitnami_jasperreports \
--network jasperreports-network \
--volume /path/to/jasperreports-persistence:/bitnami/jasperreports \
bitnami/jasperreports:latest
Customizable environment variables
Name | Description | Default Value |
---|---|---|
JASPERREPORTS_DATA_TO_PERSIST | Files to persist relative to the JasperReports installation directory. To provide multiple values, separate them with a whitespace. | buildomatic/default_master.properties buildomatic/conf_source/db/mysql/db.template.properties buildomatic/conf_source/db/postgresql/db.template.properties .jrsks .jrsksp |
JASPERREPORTS_HOST | JasperReports host name. | localhost |
JASPERREPORTS_SKIP_BOOTSTRAP | Whether to perform initial bootstrapping for the application. | no |
JASPERREPORTS_USE_ROOT_URL | Move the application to root. | false |
JASPERREPORTS_USERNAME | JasperReports user name. | jasperadmin |
JASPERREPORTS_PASSWORD | JasperReports user password. | bitnami |
JASPERREPORTS_EMAIL | JasperReports user e-mail address. | user@example.com |
JASPERREPORTS_SMTP_PROTOCOL | JasperReports SMTP server protocol to use. | smtp |
JASPERREPORTS_SMTP_EMAIL | JasperReports SMTP server email to use. | fromuser@example.com |
JASPERREPORTS_DATABASE_TYPE | Database server type. | mariadb |
JASPERREPORTS_DATABASE_HOST | Database server host. | $JASPERREPORTS_DEFAULT_DATABASE_HOST |
JASPERREPORTS_DATABASE_PORT_NUMBER | Database server port. | 3306 |
JASPERREPORTS_DATABASE_NAME | Database name. | bitnami_jasperreports |
JASPERREPORTS_DATABASE_USER | Database user name. | bn_jasperreports |
Read-only environment variables
Name | Description | Value |
---|---|---|
JASPERREPORTS_BASE_DIR | JasperReports installation directory. | ${BITNAMI_ROOT_DIR}/jasperreports |
JASPERREPORTS_CONF_DIR | Configuration directory for JasperReports. | ${JASPERREPORTS_BASE_DIR}/buildomatic |
JASPERREPORTS_LOGS_DIR | Log directory for JasperReports. | ${JASPERREPORTS_BASE_DIR}/WEB-INF/logs |
JASPERREPORTS_LOG_FILE | Log file for JasperReports. | ${JASPERREPORTS_LOGS_DIR}/jasperserver.log |
JASPERREPORTS_CONF_FILE | Configuration file for JasperReports. | ${JASPERREPORTS_CONF_DIR}/default_master.properties |
JASPERREPORTS_VOLUME_DIR | JasperReports directory for mounted configuration files. | ${BITNAMI_VOLUME_DIR}/jasperreports |
JASPERREPORTS_DAEMON_USER | JasperReports system user. | tomcat |
JASPERREPORTS_DAEMON_GROUP | JasperReports system group. | tomcat |
JASPERREPORTS_TOMCAT_AJP_PORT_NUMBER | Tomcat AJP port number. | 8009 |
JASPERREPORTS_DEFAULT_DATABASE_HOST | Default database server host. | mariadb |
JASPERREPORTS_DEFAULT_DATABASE_HOST | Default database server host. | 127.0.0.1 |
When you start the JasperReports image, you can adjust the configuration of the instance by passing one or more environment variables either on the docker-compose file or on the docker run
command line. If you want to add a new environment variable:
For docker-compose add the variable name and value under the application section in the docker-compose.yml
file present in this repository:
jasperreports:
...
environment:
- JASPERREPORTS_PASSWORD=my_password
...
For manual execution add a --env
option with each variable and value:
$ docker run -d --name jasperreports -p 80:8080 -p 443:8443 \
--env JASPERREPORTS_PASSWORD=my_password \
--network jasperreports-tier \
--volume /path/to/jasperreports-persistence:/bitnami \
bitnami/jasperreports:latest
Examples
This would be an example of SMTP configuration using a Gmail account:
Modify the docker-compose.yml
file present in this repository:
jasperreports:
...
environment:
- JASPERREPORTS_DATABASE_USER=bn_jasperreports
- JASPERREPORTS_DATABASE_NAME=bitnami_jasperreports
- ALLOW_EMPTY_PASSWORD=yes
- JASPERREPORTS_SMTP_HOST=smtp.gmail.com
- JASPERREPORTS_SMTP_PORT_NUMBER=587
- JASPERREPORTS_SMTP_PROTOCOL=smtps
- JASPERREPORTS_SMTP_USER=your_email@gmail.com
- JASPERREPORTS_SMTP_PASSWORD=your_password
...
For manual execution:
$ docker run -d --name jasperreports -p 80:8080 -p 443:8443 \
--env JASPERREPORTS_DATABASE_USER=bn_jasperreports \
--env JASPERREPORTS_DATABASE_NAME=bitnami_jasperreports \
--env JASPERREPORTS_SMTP_HOST=smtp.gmail.com \
--env JASPERREPORTS_SMTP_PORT_NUMBER=587 \
--env JASPERREPORTS_SMTP_PROTOCOL=smtps \
--env JASPERREPORTS_SMTP_USER=your_email@gmail.com \
--env JASPERREPORTS_SMTP_PASSWORD=your_password \
--network jasperreports-tier \
--volume /path/to/jasperreports-persistence:/bitnami \
bitnami/jasperreports:latest
The Bitnami JasperReports container supports connecting the JasperReports application to an external database. This would be an example of using an external database for JasperReports.
Modify the docker-compose.yml
file present in this repository:
jasperreports:
...
environment:
- - JASPERREPORTS_DATABASE_HOST=mariadb
+ - JASPERREPORTS_DATABASE_HOST=mariadb_host
- JASPERREPORTS_DATABASE_PORT_NUMBER=3306
- JASPERREPORTS_DATABASE_NAME=jasperreports_db
- JASPERREPORTS_DATABASE_USER=jasperreports_user
- - ALLOW_EMPTY_PASSWORD=yes
+ - JASPERREPORTS_DATABASE_PASSWORD=jasperreports_password
...
For manual execution:
$ docker run -d --name jasperreports\
-p 8080:8080 -p 8443:8443 \
--network jasperreports-network \
--env JASPERREPORTS_DATABASE_HOST=mariadb_host \
--env JASPERREPORTS_DATABASE_PORT_NUMBER=3306 \
--env JASPERREPORTS_DATABASE_NAME=jasperreports_db \
--env JASPERREPORTS_DATABASE_USER=jasperreports_user \
--env JASPERREPORTS_DATABASE_PASSWORD=jasperreports_password \
--volume jasperreports_data:/bitnami/jasperreports \
bitnami/jasperreports:latest
In case the database already contains data from a previous JasperReports installation, you need to set the variable JASPERREPORTS_SKIP_BOOTSTRAP
to yes
. Otherwise, the container would execute the installation wizard and could modify the existing data in the database. Note that, when setting JASPERREPORTS_SKIP_BOOTSTRAP
to yes
, values for environment variables such as JASPERREPORTS_USERNAME
, JASPERREPORTS_PASSWORD
or JASPERREPORTS_EMAIL
will be ignored.
The Bitnami JasperReports Docker image sends the container logs to stdout
. To view the logs:
docker logs jasperreports
Or using Docker Compose:
docker-compose logs jasperreports
You can configure the containers logging driver using the --log-driver
option if you wish to consume the container logs differently. In the default configuration docker uses the json-file
driver.
To backup your data, configuration and logs, follow these simple steps:
Step 1: Stop the currently running container
docker stop jasperreports
Or using Docker Compose:
docker-compose stop jasperreports
Step 2: Run the backup command
We need to mount two volumes in a container we will use to create the backup: a directory on your host to store the backup in, and the volumes from the container we just stopped so we can access the data.
docker run --rm -v /path/to/jasperreports-backups:/backups --volumes-from jasperreports bitnami/minideb \
cp -a /bitnami/jasperreports /backups/latest
Restoring a backup is as simple as mounting the backup as volumes in the containers.
For the MariaDB database container:
$ docker run -d --name mariadb \
...
- --volume /path/to/mariadb-persistence:/bitnami/mariadb \
+ --volume /path/to/mariadb-backups/latest:/bitnami/mariadb \
bitnami/mariadb:latest
For the JasperReports container:
$ docker run -d --name jasperreports \
...
- --volume /path/to/jasperreports-persistence:/bitnami/jasperreports \
+ --volume /path/to/jasperreports-backups/latest:/bitnami/jasperreports \
bitnami/jasperreports:latest
Note: the README for this image is longer than the DockerHub length limit of 25000, so has been trimmed. The full README can be found at https://github.com/bitnami/containers/blob/main/bitnami/jasperreports/README.md