---
description: Build & Deploy BA & DI Pentaho Server Containers ..
---

# BA & DI Servers

The Container 'image' build is completed in 2 stages:

* Stage 1: validates required packages based on parameters/configuration selected. Any declared Plugin Packages, Service Packs are 'exploded' and added to the base 'image'.
* Stage 2: is to build and deploy the final 'Image'.

{% tabs %}
{% tab title="BA Server" %}
{% hint style="info" %}
Pentaho BA Server consists of all the server plugins:

* PAZ - Analyzer
* PIR - Interactive Reporting
* PDD - Dashboard Designer
{% endhint %}



{% embed url="https://loom.com/share/808b6016857a41ca9310ba417527e017?hideEmbedTopBar=true&hide_owner=true&hide_share=true&hide_title=true" %}
BA Server
{% endembed %}

#### Delete previous Pentaho Containers

{% hint style="danger" %}
Only perform the Tasks in this section if you have previously built & deployed a Pentaho container.

To ensure a clean environment:

* delete the generatedFiles directory.&#x20;

You can obviously rename the directory and reference.&#x20;

* delete all Containers, Volumes and Images.
{% endhint %}

1. Stop Containers:

```bash
cd
cd ~/DockMaker-9.5/dock-maker-9.5.0.0-240/generatedFiles
docker compose down
```

2. Delete all Containers and Images:

{% hint style="danger" %}
The next command will remove everything ..  use with caution ..

If you wish to remove just the specific Pentaho Containers and Images via the command line:

docker ps                - lists containers

docker rm  \<container-id>

docker images -a   - retrieves image ids

docker rmi \<image-id> \<image-id> ...
{% endhint %}

```bash
docker rm -vf $(docker ps -aq)
docker rmi -f $(docker images -aq)
```

3. Delete the generatedFiles directory:

```bash
cd
cd DockMaker-9.5/dock-maker-9.5.0.0-240
sudo rm -rf generatedFiles
```

***

#### Configure Dockerfile

1. Check Docker is up and running:

```
docker info
```

2. Check the Pentaho artefacts have been copied over to the artifactCache directory:

```bash
cd
cd DockMaker-9.5/dock-maker-9.5.0.0-240/artifactCache
ls
```

3. Run the following command:

```bash
cd
cd ~/DockMaker-9.5/dock-maker-9.5.0.0-240
sh DockMaker.sh -V 9.5.0.0/240/ee -A std -p 8085 -U --EULA_ACCEPT=true
```

{% hint style="info" %}
To automate the build and deploy add the flag: -X

The output generates 2 Docker commands to build and deploy the image.
{% endhint %}

```
Warning: Nashorn engine is planned to be removed from a future JDK release
Downloading Artifacts
 skipping download of pentaho-server-ee-9.5.0.0-240-dist.zip it is already downloaded
Staging artifacts
Modifying Docker File
Docker File successfully modified
NOT EXECUTED: sudo docker build -f /home/installer/DockMaker-9.5/dock-maker-9.5.0.0-240/generatedFiles/Dockerfile -t pentaho/pentaho-server:9.5.0.0 /home/pentaho/DockMaker-9.5/dock-maker-9.5.0.0-240/generatedFiles
NOT EXECUTED: sudo docker-compose -f /home/installer/DockMaker-9.5/dock-maker-9.5.0.0-240/generatedFiles/docker-compose.yml up
```



<table><thead><tr><th width="97.66666666666666">Flag</th><th width="133">Mandatory</th><th>Description</th></tr></thead><tbody><tr><td>-V</td><td>Yes</td><td>The version of the pentaho server to download as a base installation followed by a "/", followed by the distribution build number, followed by another “/”, followed by "ce" or "ee". For example "9.5.0.0/240/ee" installs pentaho server-ee version 9.5.0.0 build 240.</td></tr><tr><td>-A</td><td>No</td><td>Contains acronyms for the plugin products to be installed  plugin types are "std", "paz", "pdd" and "pir". Enter all plugins to install, separated with commas, or leave blank to install no additional plugins. </td></tr><tr><td>std</td><td>No</td><td>A special entry that will add all the server plugins without the need to specify them individually.</td></tr><tr><td>-p</td><td>No</td><td>Sets the tomcat port number to use for server communication.  If omitted, it uses port 8081 for the server, and 8082 for carte.</td></tr><tr><td>-U</td><td>No</td><td>Set this flag to re-use any existing downloaded artifacts. If omitted, artifacts will always be downloaded.</td></tr></tbody></table>

***

#### Build & Deploy Pentaho BA server

1. Run the following command to build the DI server image:

```bash
cd
cd ~/DockMaker-9.5/dock-maker-9.5.0.0-240/generatedFiles
docker build -t pentaho/ba-server-9.5.0.0 .
```

{% hint style="info" %}
The `-t` flag is for `docker tag` with the image id - image name:tag
{% endhint %}

```
[+] Building 89.1s (9/18)                                                                                                                            
[+] Building 89.2s (9/18)                                                                                                                            
[+] Building 89.4s (9/18)                                                                                                                            
[+] Building 157.1s (18/19)                                                                                                                          
 => [internal] load build definition from Dockerfile                                                                                            0.0s
 => => transferring dockerfile: 5.97kB                                                                                                          0.0s
 => [internal] load .dockerignore                                                                                                               0.0s
 => => transferring context: 2B                                                                                                                 0.0s
 => [internal] load metadata for docker.io/library/openjdk:11                                                                                 157.0s
 => [internal] load build context                                                                                                              17.8s
 => => transferring context: 1.68GB                                                                                                            16.0s
 => [install_unpack 1/9] FROM docker.io/library/openjdk:11@sha256:99bac5bf83633e3c7399aed725c8415e7b569b54e03e4599e580fc9cdb7c21ab             17.8s
 => => resolve docker.io/library/openjdk:11@sha256:99bac5bf83633e3c7399aed725c8415e7b569b54e03e4599e580fc9cdb7c21ab                             0.0s
 => => sha256:001c52e26ad57e3b25b439ee0052f6692e5c0f2d5d982a00a8819ace5e521452 55.00MB / 55.00MB                                                1.4s
 => => sha256:2068746827ec1b043b571e4788693eab7e9b2a95301176512791f8c317a2816a 10.88MB / 10.88MB                                                0.7s
 => => sha256:99bac5bf83633e3c7399aed725c8415e7b569b54e03e4599e580fc9cdb7c21ab 1.04kB / 1.04kB                                                  0.0s
 => => sha256:e81b7f317654b0f26d3993e014b04bcb29250339b11b9de41e130feecd4cd43c 1.79kB / 1.79kB       
 ....
```

2. Run the following command to deploy:

```bash
cd
cd ~/DockMaker-9.5/dock-maker-9.5.0.0-240/generatedFiles
docker compose up -d
```

```
+] Running 15/16
 ⠿ repository Pulled                                                       6.7s
   ⠿ 1cb79db8a9e7 Pull complete                                            1.7s
   ⠿ f6bae7873dd7 Pull complete                                            1.9s
   ⠿ 8f7722dc50a7 Pull complete                                            2.0s
   ⠿ e8622b8cb6f3 Pull complete                                            2.0s
   ⠿ d6d74bba3a57 Pull complete                                            2.3s
   ⠿ 874d4d2a09fd Pull complete                                            2.4s
   ⠿ 2d87c3a4038c Pull complete                                            2.5s
   ⠿ f955a6cf127b Pull complete                                            2.5s
   ⠿ f62dc55c568d Pull complete                                            5.0s
   ⠿ 4e2c4902efbd Pull complete                                            5.0s
   ⠿ 01c676df543a Pull complete                                            5.1s
   ⠿ 1e3d335ef0b7 Pull complete                                            5.1s
   ⠿ 11087f2b0d87 Pull complete                                            5.2s
   ⠿ 4b9a74ac6ea0 Pull complete                                            5.2s
 ⠿ pentahoServer Warning                                                   1.1s
[+] Building 32.5s (18/19)                                                      
 => [internal] load build definition from Dockerfile                       0.0s
 => => transferring dockerfile: 5.97kB                                     0.0s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => [internal] load metadata for docker.io/library/openjdk:11             32.5s
 => [internal] load build context                                         31.8s
 => => transferring context: 1.68GB       
 ....
```

3. Take a look at the containers in Visual Studio Code or Portainer.

<figure><img src="https://content.gitbook.com/content/7IROMjOTNySvPnpnJs27/blobs/PYRzgVhQES3lISs52U7D/ba%20containers.png" alt=""><figcaption><p>Pentaho Server container</p></figcaption></figure>

{% embed url="http://localhost:8085/pentaho" %}

<figure><img src="https://content.gitbook.com/content/7IROMjOTNySvPnpnJs27/blobs/k8gjaMY1CGTwejftXcIP/ba-server.png" alt=""><figcaption><p>Pentaho User Console</p></figcaption></figure>
{% endtab %}

{% tab title="DI Server" %}
{% hint style="info" %}
The Pentaho DI Server is deployed without the plugins ..
{% endhint %}

{% embed url="https://loom.com/share/444d285297c44dd4a515a8f29e1d96dd?hideEmbedTopBar=true&hide_owner=true&hide_share=true&hide_title=true" %}
di server
{% endembed %}

#### Delete previous Pentaho Containers

{% hint style="warning" %}
Only perform the Tasks in this section if you have previously built & deployed a Pentaho container.

To ensure a clean deployment:

* delete the generatedFiles directory.&#x20;

You can obviously rename the directory and reference.&#x20;

* delete all Containers, Volumes and Images.
{% endhint %}

1. Stop Containers:

```bash
cd
cd ~/DockMaker-9.5/dock-maker-9.5.0.0-240/generatedFiles
docker compose down
```

2. Delete all Containers and Images:

{% hint style="danger" %}
The next command will remove everything ..  use with caution ..

If you wish to remove just the specific Pentaho Containers and Images vis the command line:

docker ps                - lists containers

docker rm  \<container-id>

docker images -a   - retrieves image ids

docker rmi \<image-id> \<image-id> ...
{% endhint %}

```bash
docker rm -vf $(docker ps -aq)
docker rmi -f $(docker images -aq)
```

3. Delete the generatedFiles directory:

```bash
cd
cd ~/DockMaker-9.5/dock-maker-9.5.0.0-240
sudo rm -rf generatedFiles
```

***

#### Check Docker

1. Check Docker is up and running:

```
docker info
```

#### Troubleshooting

{% hint style="info" %}
If you receive the following error message:

Error response from daemon: cannot stop container: 67034c5ca58a: permission denied&#x20;

Error response from daemon: cannot stop container: ff0171f749e8: permission denied
{% endhint %}

Run the following command:

```bash
sudo aa-remove-unknown
```

{% hint style="info" %}
The problem is due to the docker package not installing a profile for docker in the AppArmor service, so docker is categorized as 'unknown' by AppArmor. The above command removes the profile for all unknown applications, so they are no longer restricted by AppArmor.
{% endhint %}

***

#### Configure Dockerfile

1. Check the Pentaho artefacts have been copied over to the artefactCache directory:

```bash
cd
cd ~/DockMaker-9.5/dock-maker-9.5.0.0-240/artifactCache
ls
```

2. Run the following command:

```bash
cd
cd ~/DockMaker-9.5/dock-maker-9.5.0.0-240
./DockMaker.sh -V 9.5.0.0/240/ee -T server -p 8085 -U --EULA_ACCEPT=true
```

💡 To automate the build and deploy add the flag: -X

```
Warning: Nashorn engine is planned to be removed from a future JDK release
Downloading Artifacts
 skipping download of pentaho-server-ee-9.5.0.0-240-dist.zip it is already downloaded
Staging artifacts
Modifying Docker File
Docker File successfully modified
NOT EXECUTED: sudo docker build -f /home/installer/DockMaker-9.5/dock-maker-9.5.0.0-240/generatedFiles/Dockerfile -t pentaho/pentaho-server:9.5.0.0 /home/pentaho/DockMaker-9.5/dock-maker-9.5.0.0-240/generatedFiles
NOT EXECUTED: sudo docker-compose -f /home/installer/DockMaker-9.5/dock-maker-9.5.0.0-240/generatedFiles/docker-compose.yml up
```

<table><thead><tr><th width="98">Flag</th><th width="115">Mandatory</th><th>Description</th></tr></thead><tbody><tr><td>-V</td><td>Yes</td><td>The version of the pentaho server to download as a base installation followed by a "/", followed by the distribution build number, followed by another “/”, followed by "ce" or "ee". For example "9.5.0.0/240/ee" installs pentaho server-ee version 9.5.0.0 build 240.</td></tr><tr><td>-T</td><td>No</td><td><table data-header-hidden><thead><tr><th></th><th></th></tr></thead><tbody><tr><td>The type of product this image represents.  Valid values are:</td><td></td></tr><tr><td>Value</td><td>Description</td></tr><tr><td>server</td><td>The docker image will contain a fully functional pentaho-server.  It is the default value if omitted.</td></tr><tr><td>pdi</td><td>The docker image will contain a pdi kernel sufficient to run pan and kitchen commands.</td></tr><tr><td>carte</td><td>The docker image will contain a fully functional carte server.</td></tr><tr><td>spoon</td><td>The docker image will contain a runnable spoon instance (See more below)</td></tr></tbody></table></td></tr><tr><td>-p</td><td>No</td><td>Sets the tomcat port number to use for server communication.  If omitted, it uses port 8081 for the server, and 8082 for carte.</td></tr><tr><td>-U</td><td>No</td><td>Set this flag to re-use any existing downloaded artifacts. If omitted, artifacts will always be downloaded.</td></tr></tbody></table>

{% hint style="info" %}
The output is generates 2 Docker commands to build and deploy the image.
{% endhint %}

***

#### Build & Deploy Pentaho DI Server

1. Run the following command to build the DI server image:

```bash
cd
cd ~/DockMaker-9.5/dock-maker-9.5.0.0-240/generatedFiles
docker build -t pentaho/di-server-9.5.0.0 .
```

💡 The `-t` flag is just shorthand instead of building the image and running `docker tag` afterwards to tag the image id - image name:tag

```
[+] Building 0.4s (19/19) FINISHED                                                                  
 => [internal] load build definition from Dockerfile                                           0.0s
 => => transferring dockerfile: 5.96kB                                                         0.0s
 => [internal] load .dockerignore                                                              0.0s
 => => transferring context: 2B                                                                0.0s
 => [internal] load metadata for docker.io/library/openjdk:11                                  0.3s
 => [internal] load build context                                                              0.0s
 => => transferring context: 828B                                                              0.0s
 => [pack 1/6] FROM docker.io/library/openjdk:11@sha256:99bac5bf83633e3c7399aed725c8415e7b569  0.0s
 => CACHED [pack 2/6] RUN apt update; apt install -y libxtst6 libxi6 libxrender1               0.0s
 => CACHED [pack 3/6] RUN groupadd --gid 5000 pentaho     && useradd --home-dir /home/pentaho  0.0s
 => CACHED [install_unpack 2/9] WORKDIR /opt/pentaho-installer/                                0.0s
 => CACHED [install_unpack 3/9] COPY ./stagedArtifacts/* /opt/pentaho-installer/               0.0s
 => CACHED [install_unpack 4/9] RUN if [ ! -f "/opt/pentaho-installer/pentaho-server-ee-9.5.0  0.0s
 => CACHED [install_unpack 5/9] RUN if [ ! pentaho-server-ee-9.4.0.0-343-dist.zip = *"SNAPSHO  0.0s
 => CACHED [install_unpack 6/9] RUN if [ -f "LPpSV1hsvD28peed5T42bBH12iBH8iYcRc" ];     then     0.0s
 => CACHED [install_unpack 7/9] RUN if [ -f "LPpSV1hsvD28peed5T42bBH12iBH8iYcRc" ];     then     0.0s
 => CACHED [install_unpack 8/9] RUN if [ -f "LPpSV1hsvD28peed5T42bBH12iBH8iYcRc" ];     then     0.0s
 => CACHED [install_unpack 9/9] RUN if [ ! -z "" ]; then         if [ ! -f "/opt/pentaho-inst  0.0s
 => CACHED [pack 4/6] COPY --from=install_unpack --chown=pentaho:pentaho /opt/pentaho/pentaho  0.0s
 => CACHED [pack 5/6] COPY ./entrypoint/ /                                                     0.0s
 => CACHED [pack 6/6] WORKDIR /opt/pentaho/pentaho-server                                      0.0s
 => exporting to image                                                                         0.0s
 => => exporting layers                                                                        0.0s
 => => writing image sha256:345a7ef940897a2959f171a35c83ca9ca8add03e141715b020295cafe7c6ea48   0.0s
 => => naming to docker.io/pentaho/di-server-9.5.0.0  
```

2. Run the following command to deploy:

```bash
cd
cd ~/DockMaker-9.5/dock-maker-9.5.0.0-240/generatedFiles
docker compose up -d
```

```
[+] Running 15/16
 ⠿ repository Pulled                                                       5.4s
   ⠿ 1cb79db8a9e7 Pull complete                                            1.5s
   ⠿ f6bae7873dd7 Pull complete                                            1.6s
   ⠿ 8f7722dc50a7 Pull complete                                            1.7s
   ⠿ e8622b8cb6f3 Pull complete                                            1.8s
   ⠿ d6d74bba3a57 Pull complete                                            2.1s
   ⠿ 874d4d2a09fd Pull complete                                            2.1s
   ⠿ 2d87c3a4038c Pull complete                                            2.2s
   ⠿ f955a6cf127b Pull complete                                            2.2s
   ⠿ f62dc55c568d Pull complete                                            3.6s
   ⠿ 4e2c4902efbd Pull complete                                            3.6s
   ⠿ 01c676df543a Pull complete                                            3.7s
   ⠿ 1e3d335ef0b7 Pull complete                                            3.8s
   ⠿ 11087f2b0d87 Pull complete                                            3.9s
   ⠿ 4b9a74ac6ea0 Pull complete                                            3.9s
 ⠿ pentahoServer Warning                                                   1.0s
[+] Building 0.4s (18/19)                                                       
 => [internal] load build definition from Dockerfile                       0.0s
 => => transferring dockerfile: 5.96kB                                     0.0s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => [internal] load metadata for docker.io/library/openjdk:11              0.3s
 => [internal] load build context                                          0.0s
 => => transferring context: 828B                                          0.0s
 => [install_unpack 1/9] FROM docker.io/library/openjdk:11@sha256:99bac5b  0.0s
 => CACHED [pack 2/6] RUN apt update; apt install -y libxtst6 libxi6 libx  0.0s
 => CACHED [pack 3/6] RUN groupadd --gid 5000 pentaho     && useradd --ho  0.0s
 => CACHED [install_unpack 2/9] WORKDIR /opt/pentaho-installer/            0.0s
 => CACHED [install_unpack 3/9] COPY ./stagedArtifacts/* /opt/pentaho-ins  0.0s
 => CACHED [install_unpack 4/9] RUN if [ ! -f "/opt/pentaho-installer/pen  0.0s
 => CACHED [install_unpack 5/9] RUN if [ ! pentaho-server-ee-9.5.0.0-240-  0.0s
 => CACHED [install_unpack 6/9] RUN if [ -f "MakeSureThisFileNameDoesNotM  0.0s
 => CACHED [install_unpack 7/9] RUN if [ -f "MakeSureThisFileNameDoesNotM  0.0s
 => CACHED [install_unpack 8/9] RUN if [ -f "MakeSureThisFileNameDoesNotM  0.0s
 => CACHED [install_unpack 9/9] RUN if [ ! -z "" ]; then         if [ ! -  0.0s
 => CACHED [pack 4/6] COPY --from=install_unpack --chown=pentaho:pentaho   0.0s
 => CACHED [pack 5/6] COPY ./entrypoint/ /                                 0.0s
 => CACHED [pack 6/6] WORKDIR /opt/pentaho/pentaho-server                  0.0s
 => exporting to image                                                     0.0s
 => => exporting layers                                                    0.0s
 => => writing image sha256:159e3e09e2479da061c26d7e5ce1b289c196fcad62292  0.0s
 => => naming to docker.io/pentaho/pentaho-server:9.5.0.0                  0.0s
[+] Running 2/2
 ⠿ Container generatedfiles-repository-1     Started                       2.4s
 ⠿ Container generatedfiles-pentahoServer-1  Started                       3.4s
```

3. Take a look at the Containers in Visual Studio Code (or you can use Portainer console):
{% endtab %}
{% endtabs %}
