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

Support for Oracle 11 #32

Open georve opened 5 years ago

georve commented 5 years ago

I want to know what changes are needed to support a oracle 11g container.

Greetings

grange74 commented 5 years ago

Hi @georve, you need to do atleast the following:

  1. download the latest official oracle 11g jdbc driver for JDK 8 and get just the jdbc jar.
  2. put the oracle jdbc driver into the drivers folder
  3. modify the Dockerfile by adding another line under "# By default, JasperReports Server only comes with Postgres & MariaDB drivers # Copy over other JBDC drivers, the deploy-jdbc-jar ant task will put it in right location" similar to the others to copy the driver into the image
  4. update the Image Features in README.md to say it includes the Oracle driver

Actually in reviewing the above step, it might be better in step 3 to modify the Dockerfile to just copy all drivers in the drivers folder so that we don't have to change the Dockerfile in future. e.g. ADD drivers/*.jar /usr/src/jasperreports-server/buildomatic/conf_source/db/app-srv-jdbc-drivers/

grange74 commented 5 years ago

Sorry @georve, after doing some more research, it seems that it is NOT possible to include the oracle jdbc driver in this container image due to legal requirements. See https://opensource.stackexchange.com/questions/2904/can-i-use-oracles-jdbc-driver-in-an-mit-licenced-project

An alternative might be to allow drivers to be loaded on startup by mounting a folder. We need to check if that is possible. Otherwise you will have to fork this code and make the previously suggested changes and then build the image yourself.

georve commented 5 years ago

hi i made some test to update the new source here is the dockerfile using your project as base

FROM retriever/jasperserver MAINTAINER Georman Calderon georman.calderon@smartmatic.com

ENV JASPERSERVER_VERSION 7.1.0 ENV TOMCAT_HOME /usr/local/tomcat ENV ORACLE_BASE /u01/app/oracle ENV ORACLE_HOME /u01/app/oracle/product/11.2.0/xe ENV ORACLE_SID XE ENV DATABASE_PORT 1521 ENV JASPERSERVER_BUILDOMATIC_DIR /usr/src/jasperreports-server/buildomatic

RUN mkdir -p $JASPERSERVER_BUILDOMATIC_DIR/conf_source/db/oracle/jdbc \ && mkdir $JASPERSERVER_BUILDOMATIC_DIR/install_resources/sql/oracle \ && cp $JASPERSERVER_BUILDOMATIC_DIR/install_resources/export/js-catalog-mysql-minimal-ce.zip $JASPERSERVER_BUILDOMATIC_DIR/install_resources/export/js-catalog-oracle-minimal-ce.zip

grab some Oracle configuration files from JasperReports Server 5.6.0

ENV JASPERSERVER5_DOWNLOAD_URL http://downloads.sourceforge.net/project/jasperserver/JasperServer/JasperReports%20Server%20Community%20Edition%205.6.0/jasperreports-server-cp-5.6.0-bin.zip

RUN apt-get update \ && apt-get install -y bsdtar

RUN curl -f#L $JASPERSERVER5_DOWNLOAD_URL | bsdtar -C /tmp -xf- jasperreports-server-cp-5.6.0-bin/buildomatic/conf_source/db/oracle/* jasperreports-server-cp-5.6.0-bin/buildomatic/install_resources/sql/oracle/killSession.sql jasperreports-server-cp-5.6.0-bin/buildomatic/install_resources/sql/oracle/quartz.ddl \ \

run bash to use brace expansion

&& /bin/bash -c "mv /tmp/jasperreports-server-cp-5.6.0-bin/buildomatic/conf_source/db/oracle/{db.properties,db.xml,db.template.properties,scripts.properties} $JASPERSERVER_BUILDOMATIC_DIR/conf_source/db/oracle/ \ && mv /tmp/jasperreports-server-cp-5.6.0-bin/buildomatic/install_resources/sql/oracle/{killSession.sql,quartz.ddl} $JASPERSERVER_BUILDOMATIC_DIR/install_resources/sql/oracle/" \ \ && rm -rf /tmp/*

Copy over other JBDC drivers the deploy-jdbc-jar ant task will put it in

right location ADD drivers/ojdbc6.jar $JASPERSERVER_BUILDOMATIC_DIR/conf_source/db/app-srv-jdbc-drivers/ojdbc6.jar ADD drivers/ojdbc6.jar $TOMCAT_HOME/lib/ ADD drivers/ojdbc6.jar $JASPERSERVER_BUILDOMATIC_DIR/conf_source/db/oracle/jdbc/ojdbc6.jar ADD configuration/oracle_master.properties $JASPERSERVER_BUILDOMATIC_DIR/default_master.properties

RUN ls -la /usr/src/jasperreports-server/buildomatic/

RUN sh /usr/src/jasperreports-server/buildomatic/js-install-ce.sh

Use the minimum recommended settings to start-up

as per

http://community.jaspersoft.com/documentation/jasperreports-server-install-guide/v561/setting-jvm-options-application-servers ENV JAVA_OPTS="-Xms1024m -Xmx2048m -XX:PermSize=32m -XX:MaxPermSize=512m -Xss2m -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled"

Wait for DB to start-up, start up JasperServer and bootstrap if required

ENTRYPOINT ["/entrypoint.sh"]

But when i try to run with a database container it never start..

On Mon, Jan 7, 2019 at 7:16 PM Nicolas Grange notifications@github.com wrote:

Sorry @georve https://github.com/georve, after doing some more research, it seems that it is NOT possible to include the oracle jdbc driver in this container image due to legal requirements. See https://opensource.stackexchange.com/questions/2904/can-i-use-oracles-jdbc-driver-in-an-mit-licenced-project

An alternative might be to allow drivers to be loaded on startup by mounting a folder. We need to check if that is possible. Otherwise you will have to fork this code and make the previously suggested changes and then build the image yourself.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/retrievercommunications/docker-jasperserver/issues/32#issuecomment-452116709, or mute the thread https://github.com/notifications/unsubscribe-auth/AFP87JbmCbPvAkhLc-vtWSFbOkXtR9HDks5vA9U3gaJpZM4Z0bSE .

-- Ing Georman Calderón linux user #483838 +5804127375627

grange74 commented 5 years ago

Hi @georve, it is quite hard to tell from what you have provided.

The formatting of the Dockerfile has been messed up in pasting into github.

Also for:

But when i try to run with a database container it never start..

Please provide the logs or output with any error messages.

georve commented 5 years ago

this is the only output

docker run -d -P --link ccsdb:db --volumes-from ccsdb -v jasperserver_src:/usr/src/jasperserver -v jasperserver_webapps:/usr/local/tomcat/webapps -e DATABASE_HOSTNAME="db" -p 8080:8080 cosmomill/alpine-jasperserverce-oracle:latest 160f1e13eccfa37f5db9e892eabbfa4cac22896c4b46f6316a4cf3ded71c8634

but when i try ti find the container to see the log this is down

On Tue, Jan 8, 2019 at 7:10 PM Nicolas Grange notifications@github.com wrote:

Hi @georve https://github.com/georve, it is quite hard to tell from what you have provided.

The formatting of the Dockerfile has been messed up in pasting into github.

Also for:

But when i try to run with a database container it never start..

Please provide the logs or output with any error messages.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/retrievercommunications/docker-jasperserver/issues/32#issuecomment-452485356, or mute the thread https://github.com/notifications/unsubscribe-auth/AFP87G6FN0Y9FOhL0O8FTKy1Nby0MKVZks5vBSVXgaJpZM4Z0bSE .

-- Ing Georman Calderón linux user #483838 +5804127375627

grange74 commented 5 years ago

please remove the -d so it runs in the foreground and you can see the output