The Docker Image aims to quickly get up-and-running a JasperReports Server for a development environment.
To start the JasperServer container you'll need to pass in 5 environment variables and link it to either a MySQL or Postgres container.
E.g. docker run -d --name jasperserver -e DB_TYPE=mysql -e DB_HOST=db -e DB_PORT=3306 -e DB_USER=root -e DB_PASSWORD=mysql --link jasperserver_mysql:db -p 8080:8080 retriever/jasperserver
If you haven't got an existing MySQL or Postgres container then you can easily create one:
docker run -d --name jasperserver_mysql -e MYSQL_ROOT_PASSWORD=mysql mysql:5.7
To start up the JasperServer and a MySQL container:
- Run
docker-compose up
to run in foreground or - Run
docker-compose up -d
to run as in daemon mode.
To stop the containers run docker-compose stop
and docker-compose start
to restart them.
Note: To install Docker-compose see the releases page.
- Go to URL http://${dockerHost}:8080/
- Login using credentials: jasperadmin/jasperadmin
This image includes:
- JasperServer CE Edition version 7.5.0
- IBM DB2 JDBC driver version 4.19.26, Note: this jar had to be modified as per exception-in-db2-jcc-driver-under-tomcat8.
- MySQL JDBC driver version 5.1.44
- A volume called '/import' that allows automatic importing of export zip files from another JasperReports Server
- Waits for the database to start before connecting to it using wait-for-it as recommended by docker-compose documentation.
- Web Service Data Source plugin contributed by @chiavegatto
Use docker build -t retriever/jasperserver .
See comments in Dockerfile to speed up testing by not having to download the jasperserver release each time.
If you are having problems starting the containers because of a MySQL error like "[ERROR] [FATAL] Innodb: Table flags are 0...", then you will need to delete the data_dir which contains the MySQL database and then recreate the containers. Please note that you will lose any data previously stored in the database.
Since changes-to-docker-hub-autobuilds builds have to be done manually.
Steps to make a new official version of the image:
- Push a new
git tag
using the naming conventionmajor.minor.iteration
where:- major and minor line up with the included version of jasperserver
- iteration is incremented each time a change is done that isn't an upgrade of the included jasperserver version
- Build the image locally for each tag e.g.
docker build -t retriever/jasperserver:7.5.0 -t retriever/jasperserver:latest .
- Login to dockerhub with account that has push privileges to retriever org (i.e.
docker login
) - Push image for each tag (e.g.
docker push retriever/jasperserver:7.5.0
anddocker push retriever/jasperserver:latest
) - Check images are on Docker Hub: retriever/jaserpserver
- Test new Docker Hub images by deleting local image e.g.
docker rmi retriever/jasperserver:7.5.0 retriever/jasperserver:latest
and re-downloading from Dockerhub and run up container e.g.docker-compose up
.- Note: ensure docker-compose.yml is pointing to right version and clear out local
datadir
to start fresh.
- Note: ensure docker-compose.yml is pointing to right version and clear out local