retrievercommunications / docker-jasperserver

Docker image for the community edition of JasperReports® Server.
https://hub.docker.com/r/retriever/jasperserver/
MIT License
46 stars 50 forks source link

How to pass different Database name or custome Database Name ? #40

Open kamrannawaz opened 3 years ago

kamrannawaz commented 3 years ago

hi, i want to connect jasper to azure app services mysql db but i want to pass different dbname instead of default jasperserver how to do that ?

grange74 commented 3 years ago

Currently it is not possible but this container could be changed to support a different name. We'd welcome a pull request.

Here's some useful info:

Jasperserver uses the property js.dbName for the database name to create and connect to. Currently in this container it is left as the default name 'jasperserver'.

In order to make the change, you'd just have to pass in a new environment variable -e DB_NAME=someothername and then modify the entrypoint.sh on line 19 in this repo to replace the default like is already done for the other database settings. https://github.com/retrievercommunications/docker-jasperserver/blob/master/entrypoint.sh#L19

Below is what the mysql sample conf file that comes with Jasper release:

# database type
dbType=mysql

# database location and connection settings

dbHost=localhost
dbUsername=root
dbPassword=password

# additional database parameters
# (uncomment these if you want non-default settings)

# dbPort=3306

# JasperServer db name
# js.dbName=jasperserver
kamrannawaz commented 3 years ago

yeah i checked it and replace it through entry.sh file but now i m getting flush host error could you plz guide what is this ?