├── .gitignore ├── scripts ├── install_plugin.sh ├── run.sh ├── replace.sh └── setup_postgresql.sh ├── config ├── context.xml ├── jdbc.properties └── repository.xml ├── LICENSE ├── Dockerfile └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | hsqldb 2 | -------------------------------------------------------------------------------- /scripts/install_plugin.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "${INSTALL_PLUGIN}" ]; then 4 | wget --no-check-certificate 'https://raw.github.com/pmalves/ctools-installer/master/ctools-installer.sh' -P / -o /dev/null 5 | 6 | chmod +x ctools-installer.sh 7 | ./ctools-installer.sh -s $PENTAHO_SERVER/pentaho-solutions -w $PENTAHO_SERVER/tomcat/webapps/pentaho -y -c ${INSTALL_PLUGIN} 8 | fi 9 | -------------------------------------------------------------------------------- /scripts/run.sh: -------------------------------------------------------------------------------- 1 | if [ ! -f ".pentaho_pgconfig" ]; then 2 | sh $PENTAHO_HOME/scripts/setup_postgresql.sh 3 | #HOSTNAME=$(`echo hostname`) 4 | 5 | sed -i "s/node1/${HOSTNAME}/g" ${PENTAHO_SERVER}/pentaho-solutions/system/jackrabbit/repository.xml 6 | touch .pentaho_pgconfig 7 | fi 8 | 9 | if [ ! -f ".install_plugin" ]; then 10 | sh $PENTAHO_HOME/scripts/install_plugin.sh 11 | touch .install_plugin 12 | fi 13 | 14 | if [ -f "./custom_script.sh" ]; then 15 | . ./custom_script.sh 16 | mv ./custom_script.sh ./custom_script.sh.bkp 17 | fi 18 | 19 | sh ${PENTAHO_SERVER}/start-pentaho.sh -------------------------------------------------------------------------------- /scripts/replace.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | str_search="$1" 4 | str_replace="$2" 5 | opts="$3" 6 | file_pattern="$4" 7 | infile="" 8 | 9 | if [ "$5" = "-infile" ] 10 | then 11 | infile="-i" 12 | fi 13 | 14 | case "$opts" in 15 | "-file") 16 | /bin/sed $infile 's/'$str_search'/'$str_replace'/g' $file_pattern 17 | ;; 18 | "-path") 19 | files=`grep -rl $str_search $file_pattern` 20 | #echo $files 21 | echo $files | /usr/bin/xargs /bin/sed $infile 's/'$str_search'/'$str_replace'/g' 22 | ;; 23 | "-file_pattern") 24 | find . -name $file_pattern -type f -print0 | xargs -0 /bin/sed $infile 's/'$str_search'/'$str_replace'/g' 25 | ;; 26 | *) 27 | echo "Usage: $0 old_str new_str -file filename > new_file" 28 | echo "Usage: $0 old_str new_str -file_pattern /path/*.*" 29 | echo "Usage: $0 old_str new_str -path /path/ -infile " 30 | ;; 31 | esac 32 | exit 0 -------------------------------------------------------------------------------- /config/context.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Jonathan DeMarks 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /config/jdbc.properties: -------------------------------------------------------------------------------- 1 | # Copyright 2008 - 2010 Pentaho Corporation. All rights reserved. 2 | # This program is free software; you can redistribute it and/or modify it under the 3 | # terms of the GNU Lesser General Public License, version 2.1 as published by the Free Software 4 | # Foundation. 5 | # 6 | # You should have received a copy of the GNU Lesser General Public License along with this 7 | # program; if not, you can obtain a copy at http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html 8 | # or from the Free Software Foundation, Inc., 9 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 10 | # 11 | # This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 12 | # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13 | # See the GNU Lesser General Public License for more details. 14 | SampleData/type=javax.sql.DataSource 15 | SampleData/driver=org.hsqldb.jdbcDriver 16 | SampleData/url=jdbc:hsqldb:hsql://localhost/sampledata 17 | SampleData/user=pentaho_user 18 | SampleData/password=password 19 | Hibernate/type=javax.sql.DataSource 20 | Hibernate/driver=org.postgresql.jdbcDriver 21 | Hibernate/url=jdbc:postgresql:postgresql://localhost:5432/hibernate 22 | Hibernate/user=hibuser 23 | Hibernate/password=password 24 | Quartz/type=javax.sql.DataSource 25 | Quartz/driver=org.postgresql.jdbcDriver 26 | Quartz/url=jdbc:postgresql:postgresql://localhost:5432/quartz 27 | Quartz/user=pentaho_user 28 | Quartz/password=password 29 | Shark/type=javax.sql.DataSource 30 | Shark/driver=org.hsqldb.jdbcDriver 31 | Shark/url=jdbc:hsqldb:hsql://localhost/shark 32 | Shark/user=sa 33 | Shark/password= 34 | SampleDataAdmin/type=javax.sql.DataSource 35 | SampleDataAdmin/driver=org.hsqldb.jdbcDriver 36 | SampleDataAdmin/url=jdbc:hsqldb:hsql://localhost/sampledata 37 | SampleDataAdmin/user=pentaho_admin 38 | SampleDataAdmin/password=password 39 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:8-jre-alpine 2 | MAINTAINER Jonathan DeMarks 3 | # Based on work done by Wellington Marinho (https://github.com/wmarinho/docker-pentaho) 4 | # Note: Really, really requires Postgres 9.5, any higher version will break without an updated driver (in commented section below). 5 | 6 | ENV MAJOR_VERSION 7.0 7 | ENV MINOR_VERSION 7.0.0.0-25 8 | ENV PENTAHO_HOME /opt/pentaho 9 | ENV PENTAHO_JAVA_HOME $JAVA_HOME 10 | ENV PENTAHO_SERVER ${PENTAHO_HOME}/server/pentaho-server 11 | ENV CATALINA_OPTS="-Djava.awt.headless=true -Xms4096m -Xmx6144m -XX:MaxPermSize=256m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000" 12 | 13 | # Get support packages 14 | RUN apk add --update wget unzip bash postgresql-client ttf-dejavu 15 | 16 | # Setup pentaho user 17 | RUN mkdir -p ${PENTAHO_HOME}/server; mkdir ${PENTAHO_HOME}/.pentaho; adduser -D -s /bin/sh -h ${PENTAHO_HOME} pentaho; chown -R pentaho:pentaho ${PENTAHO_HOME} 18 | USER pentaho 19 | WORKDIR ${PENTAHO_HOME}/server 20 | 21 | # Get Pentaho Server 22 | RUN echo http://downloads.sourceforge.net/project/pentaho/Business%20Intelligence%20Server/${MAJOR_VERSION}/pentaho-server-ce-${MINOR_VERSION}.zip | xargs wget -qO- -O tmp.zip && \ 23 | unzip -q tmp.zip -d ${PENTAHO_HOME}/server && \ 24 | rm -f tmp.zip 25 | 26 | # Get MS SQL JDBC driver 27 | RUN echo https://download.microsoft.com/download/0/2/A/02AAE597-3865-456C-AE7F-613F99F850A8/enu/sqljdbc_6.0.8112.100_enu.tar.gz | xargs wget -qO- -O tmp.tar.gz && \ 28 | tar -zxf tmp.tar.gz && \ 29 | rm -f tmp.tar.gz && \ 30 | cp sqljdbc_6.0/enu/jre8/sqljdbc42.jar ${PENTAHO_SERVER}/tomcat/lib/ && \ 31 | rm -fr sqljdbc_6.0 32 | 33 | # Replace outdated Postgresql JDBC driver 34 | RUN rm ${PENTAHO_SERVER}/tomcat/lib/postgresql-9.3-1102-jdbc4.jar && \ 35 | echo https://jdbc.postgresql.org/download/postgresql-9.4.1212.jar | xargs wget -qO- -O ${PENTAHO_SERVER}/tomcat/lib/postgresql-9.4.1212.jar 36 | 37 | # Disable first-time startup prompt 38 | RUN rm ${PENTAHO_SERVER}/promptuser.sh 39 | 40 | # Disable daemon mode for Tomcat 41 | RUN sed -i -e 's/\(exec ".*"\) start/\1 run/' ${PENTAHO_SERVER}/tomcat/bin/startup.sh 42 | 43 | # Copy scripts and fix permissions 44 | USER root 45 | COPY scripts ${PENTAHO_HOME}/scripts 46 | COPY config ${PENTAHO_HOME}/config 47 | RUN chown -R pentaho:pentaho ${PENTAHO_HOME}/scripts && chmod -R +x ${PENTAHO_HOME}/scripts 48 | USER pentaho 49 | 50 | # Volumes: 51 | # Administration and user accounts: 52 | # /opt/pentaho/server/pentaho-server/data/hsqldb 53 | # Jackrabbit document repository: 54 | # /opt/pentaho/server/pentaho-server/pentaho-solutions/system/jackrabbit/repository 55 | VOLUME [ '/opt/pentaho/server/pentaho-server/data/hsqldb', '/opt/pentaho/server/pentaho-server/pentaho-solutions/system/jackrabbit/repository' ] 56 | 57 | EXPOSE 8080 58 | ENTRYPOINT ["sh", "-c", "$PENTAHO_HOME/scripts/run.sh"] 59 | -------------------------------------------------------------------------------- /scripts/setup_postgresql.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$RDS_HOSTNAME" ]; then 4 | PGHOST="$RDS_HOSTNAME" 5 | PGUSER="$RDS_USERNAME" 6 | PGPASSWORD="$RDS_PASSWORD" 7 | PGDATABASE="$RDS_DB_NAME" 8 | PGPORT="$RDS_PORT" 9 | fi 10 | 11 | if [ "$PGHOST" ]; then 12 | if [ ! "$PGPORT" ]; then 13 | PGPORT=5432 14 | fi 15 | if [ ! "$PGDATABASE" ]; then 16 | PGDATABASE=postgres 17 | fi 18 | if [ ! "$PGUSER" ]; then 19 | PGUSER=pgadmin 20 | fi 21 | if [ ! "$PGPASSWORD" ]; then 22 | PGPASSWORD=pgadmin. 23 | 24 | fi 25 | export PGPASSWORD="$PGPASSWORD" 26 | echo "Checking PostgreSQL connection ..." 27 | 28 | nc -zv $PGHOST $PGPORT 29 | 30 | if [ "$?" -ne "0" ]; then 31 | echo "PostgreSQL connection failed." 32 | exit 0 33 | fi 34 | 35 | CHK_QUARTZ=`echo "$(psql -U $PGUSER -h $PGHOST -d $PGDATABASE -l | grep quartz | wc -l)"` 36 | CHK_HIBERNATE=`echo "$(psql -U $PGUSER -h $PGHOST -d $PGDATABASE -l | grep hibernate | wc -l)"` 37 | CHK_JCR=`echo "$(psql -U $PGUSER -h $PGHOST -d $PGDATABASE -l | grep jackrabbit | wc -l)"` 38 | 39 | echo "quartz: $CHK_QUARTZ" 40 | echo "hibernate: $CHK_HIBERNATE" 41 | echo "jcr: $CHK_JCR" 42 | 43 | if [ "$CHK_JCR" -eq "0" ]; then 44 | psql -U $PGUSER -h $PGHOST -d $PGDATABASE -f $PENTAHO_SERVER/data/postgresql/create_jcr_postgresql.sql 45 | fi 46 | if [ "$CHK_HIBERNATE" -eq "0" ]; then 47 | psql -U $PGUSER -h $PGHOST -d $PGDATABASE -f $PENTAHO_SERVER/data/postgresql/create_repository_postgresql.sql 48 | fi 49 | if [ "$CHK_QUARTZ" -eq "0" ]; then 50 | psql -U $PGUSER -h $PGHOST -d $PGDATABASE -f $PENTAHO_SERVER/data/postgresql/create_quartz_postgresql.sql 51 | 52 | # Insert dummy table to fix "RUNSCRIPT" issue. 53 | # http://forums.pentaho.com/showthread.php?153231-Pentaho-ce-5-Initialization-Exception 54 | psql -U $PGUSER -h $PGHOST -d quartz -c 'CREATE TABLE "QRTZ" ( NAME VARCHAR(200) NOT NULL, PRIMARY KEY (NAME) );' 55 | fi 56 | 57 | # Use postgresql for hibernate 58 | if grep -q postgresql $PENTAHO_SERVER/pentaho-solutions/system/hibernate/hibernate-settings.xml; then 59 | sed -i s/hsql/postgresql/g $PENTAHO_SERVER/pentaho-solutions/system/hibernate/hibernate-settings.xml 60 | 61 | sed -i s/localhost:5432/$PGHOST:$PGPORT/g $PENTAHO_SERVER/pentaho-solutions/system/hibernate/postgresql.hibernate.cfg.xml 62 | 63 | cp $PENTAHO_HOME/config/jdbc.properties $PENTAHO_SERVER/pentaho-solutions/system/simple-jndi/jdbc.properties 64 | sed -i "s|postgresql://localhost:5432|postgresql://$PGHOST:$PGPORT|g" $PENTAHO_SERVER/pentaho-solutions/system/simple-jndi/jdbc.properties 65 | fi 66 | 67 | # Use postgreql for jackrabbit 68 | #if grep -q postgresql://localhost:5432 $PENTAHO_SERVER/pentaho-solutions/system/jackrabbit/repository.xml; then 69 | # cp $PENTAHO_HOME/config/repository.xml $PENTAHO_SERVER/pentaho-solutions/system/jackrabbit/repository.xml 70 | # sed -i "s|postgresql://localhost:5432|postgresql://$PGHOST:$PGPORT|g" $PENTAHO_SERVER/pentaho-solutions/system/jackrabbit/repository.xml 71 | #fi 72 | 73 | # Use postgresql for tomcat (quartz / hibernate) 74 | if grep -q hsqldb $PENTAHO_SERVER/tomcat/webapps/pentaho/META-INF/context.xml; then 75 | cp $PENTAHO_HOME/config/context.xml $PENTAHO_SERVER/tomcat/webapps/pentaho/META-INF/context.xml 76 | sed -i "s|jdbc:postgresql://localhost:5432/|jdbc:postgresql://$PGHOST:$PGPORT/|g" $PENTAHO_SERVER/tomcat/webapps/pentaho/META-INF/context.xml 77 | fi 78 | fi 79 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Pentaho 7.0 Docker Image 2 | 3 | ## What is Pentaho? 4 | 5 | [Pentaho](http://www.pentaho.com/) is a Business Intelligence (BI) software 6 | company that offers Pentaho Business Analytics, a suite of open source products 7 | which provide data integration, OLAP services, reporting, dashboarding, data 8 | mining and ETL capabilities. 9 | 10 | ## What is this? 11 | 12 | Pentaho has [clearly 13 | stated](https://support.pentaho.com/hc/en-us/articles/210384343-Automated-deployment-solutions-Docker-Puppet-Chef-etc-) 14 | that they will not be providing automated deployment solutions for their 15 | products. This is a problem since the deployment process is quite 16 | complicated.This docker project provides a much simpler deployment mechanism. It 17 | is not perfect, but with your help it can get better every day. :-) 18 | 19 | It is based on some really splendid work done by [Wellington 20 | Marinho](https://github.com/wmarinho/docker-pentaho). 21 | 22 | ## Requirements 23 | - [PostgreSQL](https://www.postgresql.org/) 9.4 24 | - `postgres:9.4-alpine` worked nicely for me 25 | 26 | ## How to run 27 | 28 | - Start a PostgreSQL server 29 | ``` 30 | docker run -d -p 5432:5432 --name postgres postgres:9.4-alpine 31 | ``` 32 | 33 | - Run once for testing and auto-clean container 34 | ``` 35 | docker run --rm -it --link postgres:postgres \ 36 | -e PGHOST=postgres -e PGUSER=postgres -e PGPASSWORD= -p 8080:8080 ca0abinary/docker-pentaho 37 | ``` 38 | 39 | - Start in bash, prior to any scripts having executed, auto-clean (for debugging) 40 | ``` 41 | docker run --rm -it --link postgres:postgres \ 42 | -e PGHOST=postgres -e PGUSER=postgres -e PGPASSWORD= -p 8080:8080 \ 43 | --entrypoint bash ca0abinary/docker-pentaho 44 | ``` 45 | 46 | - Run as a service 47 | ``` 48 | docker run -d --link postgres:postgres \ 49 | -e PGHOST=postgres -e PGUSER=postgres -e PGPASSWORD= -p 8080:8080 \ 50 | ca0abinary/docker-pentaho 51 | ``` 52 | 53 | ## HyperSQL 54 | 55 | It's possible to run without PostgreSQL and only use the hsqldb. 56 | 57 | If you want your data to be preserved in the event of container loss, you should 58 | keep it in a data container or volume map. 59 | 60 | - HSQLDB 61 | - Jackrabbit stores files locally at `/opt/pentaho/server/pentaho-server/pentaho-solutions/system/jackrabbit/repository` 62 | 63 | Example: 64 | ``` 65 | docker run --rm -it \ 66 | -v /mnt/nfs-share/pentaho/hsqldb:/opt/pentaho/server/pentaho-server/data/hsqldb \ 67 | -v /mnt/nfs-share/pentaho/repository:/opt/pentaho/server/pentaho-server/pentaho-solutions/system/jackrabbit/repository \ 68 | -p 8080:8080 ca0abinary/docker-pentaho 69 | ``` 70 | 71 | ## Environment variables 72 | 73 | - `PGHOST` The hostname or IP of the postgresql server 74 | - `PGPORT` The port number of the postgreql service `(default 5432)` 75 | - `PGDATABASE` The database name to use `(default postgres)` 76 | - `PGUSER` The admin username (used for creating databases / database users) `(default pgadmin)` 77 | - `PGPASSWORD` The admin password `(default pgadmin.)` 78 | 79 | ## Login Credentials 80 | 81 | - `admin` - Administrator. 82 | - `pat` - Business Analyst. 83 | - `suzy` - Power User. 84 | - `tiffany` - Report Author. 85 | 86 | Default password is `password`. 87 | 88 | ## Docker Compose Examples 89 | 90 | The simplest `docker-compose.yml` file would be: 91 | 92 | ``` 93 | version: "3" 94 | services: 95 | # Pentaho BI 96 | pentaho: 97 | container_name: pentaho 98 | image: ca0abinary/docker-pentaho 99 | depends_on: 100 | - pentaho-pg 101 | ports: 102 | - "8080:8080" 103 | environment: 104 | - HOST=pentaho-pg 105 | - USER=pentaho 106 | - PASSWORD=password 107 | volumes: 108 | - pentaho-hsqldb-data:/opt/pentaho/server/pentaho-server/data/hsqldb 109 | - pentaho-jackrabbit-data:/opt/pentaho/server/pentaho-server/pentaho-solutions/system/jackrabbit/repository 110 | 111 | # PostgreSQL Database for Pentaho BI 112 | pentaho-pg: 113 | container_name: pentaho-pg 114 | image: postgres:9.4 115 | environment: 116 | - POSTGRES_USER=pentaho 117 | - POSTGRES_PASSWORD=password 118 | - PGDATA=/var/lib/postgresql/data/pgdata 119 | volumes: 120 | - pentaho-pg-data:/var/lib/postgresql/data/pgdata 121 | 122 | # Data volumes 123 | volumes: 124 | pentaho-hsqldb-data: 125 | pentaho-jackrabbit-data: 126 | pentaho-pg-data: 127 | ``` 128 | 129 | ## Problems 130 | 131 | Quartz and Hibernate continue to live on the internal 132 | [HyperSQL](http://hsqldb.org/) database as despite changing the settings to work 133 | with PostgreSQL using the provided documentation I'm not having success. 134 | (`java.sql.SQLException: No suitable driver`) 135 | 136 | The databases will be created in PostgreSQL, just not used. 137 | 138 | Please feel free to examine the `scripts/setup_postgresql.sh` and post a PR if 139 | you can fix it! 140 | 141 | ## See Also 142 | 143 | - [Wellington 144 | Marinho](https://github.com/wmarinho/docker-pentaho). 145 | - [Pentaho 7.0 Docker Image](https://github.com/ca0abinary/docker-pentaho). 146 | - [Pentaho 7.0 Documentation](https://help.pentaho.com/Documentation/7.0). 147 | -------------------------------------------------------------------------------- /config/repository.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 22 | 23 | 24 | 34 | 42 | 43 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | --> 70 | 84 | 85 | 88 | 96 | 97 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | --> 137 | 153 | 154 | 157 | 158 | 162 | 163 | 167 | 168 | 169 | 170 | 171 | 175 | 176 | 177 | 178 | 179 | 180 | 183 | 184 | 187 | 188 | 189 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 201 | 202 | 206 | 207 | 211 | 219 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | --> 246 | 260 | 261 | 262 | 266 | 274 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | --> 303 | 319 | 320 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 339 | 340 | 344 | 352 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | --> 379 | 393 | 394 | 400 | 408 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | --> 437 | 452 | 453 | 454 | 455 | 459 | 463 | 469 | 470 | 473 | 474 | 475 | 476 | 477 | --------------------------------------------------------------------------------