Cloud Software Group, Inc. EBX®
Documentation > Administration Guide > EBX® Container Edition
Navigation modeDocumentation > Administration Guide > EBX® Container Edition

Customizing the image

The EBX® Container Edition image can be used as a parent image to create a customized image.

User specified in Docker file

The EBX® Container Edition image’s docker file specifies user ebx .

A Docker file extending the image may need to set current user to root and later switch back to ebx as in following sample:

FROM ebx:6.2.2
USER root
# Do something requiring being root...
USER ebx

Setting default configuration

Setting default EBX® configuration should not be based on /opt/ebx/conf/ebx-container.properties as this file may be overridden at runtime.

Instead, proceed as following in the Docker file:

For the list of properties supported by EBX®, see TIBCO EBX® main configuration file .

Here is a sample Docker file that set the locale to "en-US"

FROM ebx:6.2.2
USER root

RUN mv /opt/ebx/webapps/ebx/WEB-INF/ebx-default.properties \
       /opt/ebx/webapps/ebx/WEB-INF/ebx-default-original.properties

RUN echo "ebx.file.previous=ebx-default-original.properties" >> \
         /opt/ebx/webapps/ebx/WEB-INF/ebx-default.properties
RUN echo "ebx.locales.available=en-US" >> /opt/ebx/webapps/ebx/WEB-INF/ebx-default.properties

USER ebx

Adding a custom module

One can extend EBX® by developing custom modules. An EBX® module is a standard Jakarta EE web application, packaging various resources such as XML Schema documents, Java classes and static resources.

For more information on EBX® module, see Packaging TIBCO EBX® modules .

With EBX® Container Edition, it is recommended to deploy modules as "unpacked" (exploded) WARs. This allows a faster startup and avoids unnecessarily increasing container size because Tomcat will not need to unpack WAR files.

The recommended way to add a module to an image is to:

The Tomcat context XML file should have the following content:

<?xml version="1.0" encoding="UTF-8"?>
<Context docBase="${ebx.container.base}/webapps/module_war_name"/>

Using variable ${ebx.container.base} is required for correct support of environment variable EBX_ROOT_PATH .

For more information on Tomcat contexts see https://tomcat.apache.org/tomcat-10.1-doc/config/context.html#Defining_a_context .

Here is a sample Docker file:

FROM ebx:6.2.2
USER root
COPY "./module_name.xml" "/opt/ebx/contexts"
COPY "./module_name" "/opt/ebx/webapps"
USER ebx

Adding a new locale

To add one or more locales, you need the language packs software zip file(s). Here is a shell script that creates a Docker file and builds the target image. This script can be modified to suit your needs.

#!/bin/bash
#
# Build a docker image tag including language packs for
# a specified version available from the current folder.
#
# Usage: build.sh <lp-version> <from-tag> <build-tag>
#
set -e

LP_VERSION="$1"
FROM_TAG="$2"
BUILD_TAG="$3"

if (( $# != 3 )); then
  echo "Syntax $0 <lp-version> <from-tag> <build-tag>" 1>&2
  exit 1
fi

EBX_LOCALES=""

if [ -d files ]; then
  rm -rf files
fi

mkdir -p "files/lib"

for zip in TIB_ebx-lp_${LP_VERSION}_addon_*_languagepack*.zip ; do
  locale=$(echo ${zip} | sed -e 's/.*languagepack-\([a-zA-Z-]*\).zip/\1/g')
  EBX_LOCALES="${EBX_LOCALES},${locale}"
  echo unzip locale=${locale}
  unzip -oq ${zip}

  if [ -d ${locale} ] ; then
    mkdir -p "files/webapps/ebx-manager/www/${locale}"
    mv "${locale}/" "files/webapps/ebx-manager/www/"
  fi
done

mv *.jar "files/lib"

cat > Dockerfile << EOF
FROM ${FROM_TAG}

COPY "files" "/opt/ebx"

USER root

RUN mv "/opt/ebx/webapps/ebx/WEB-INF/ebx-default.properties" \
       "/opt/ebx/webapps/ebx/WEB-INF/ebx-default-original.properties" &&\
  echo "ebx.file.previous=ebx-default-original.properties" >> \
       "/opt/ebx/webapps/ebx/WEB-INF/ebx-default.properties" &&\
  echo "ebx.locales.available=en-US,fr-FR${EBX_LOCALES}" >> \
       "/opt/ebx/webapps/ebx/WEB-INF/ebx-default.properties"

USER ebx
EOF

docker build -t ${BUILD_TAG} .

echo "To run a container using this image, use command:"
echo " EBX_LOCALES=${EBX_LOCALES}"
echo " docker run -p 8080:8080 -d ${BUILD_TAG}"

In this example, libs and optional documentation are copied, then locales are set using the method described in the setting default configuration section.

Adding a new JDBC driver

Adding a new JDBC driver is similar to adding a new library. You simply have to copy the jar file in the "/opt/ebx/lib" folder with the correct permission. Here is an example with the Oracle JDBC driver:

FROM ebx:6.2.2
USER root

ADD \
 https://repo1.maven.org/maven2/com/oracle/database/jdbc/ojdbc11/23.8.0.25.04/ojdbc11-23.8.0.25.04.jar \
 "/opt/ebx/lib/"

RUN chmod +r "/opt/ebx/lib/ojdbc11-23.8.0.25.04.jar"

USER ebx

See Database drivers for more information.

Configuring the database in JNDI

To configure a JNDI data source for EBX®, you’ll need to customize your Docker image. The following sample Dockerfile demonstrates the necessary steps to integrate your ebx.xml configuration.

FROM ebx:6.2.2
USER root

RUN mv "/opt/ebx/webapps/ebx/WEB-INF/ebx-default.properties" \
       "/opt/ebx/webapps/ebx/WEB-INF/ebx-default-original.properties" ; \
    mv "/opt/ebx/contexts/ebx.xml" \
       "/opt/ebx/contexts/ebx.original" ; \
  echo "ebx.file.previous=ebx-default-original.properties" >> \
       "/opt/ebx/webapps/ebx/WEB-INF/ebx-default.properties" ; \
  echo "ebx.persistence.url=" >> /opt/ebx/webapps/ebx/WEB-INF/ebx-default.properties

COPY "./ebx.xml" "/opt/ebx/contexts"

USER ebx

The ebx.xml file manages the web application context and includes essential configuration information for the JNDI data source used by EBX®.

Critical point : each property listed below must be carefully adjusted, added, or removed depending on your database (e.g., Oracle, PostgreSQL, SQL Server, etc.) or your cloud provider.

Important : This sample file must be adapted to your specific environment before being integrated into your deployment image. UTF-8 encoding is required for the ebx.xml file.

<?xml version="1.0" encoding="UTF-8"?>
<Context docBase="${ebx.container.base}/webapps/ebx" crossContext="true">
    <Resource
        name="jdbc/EBX_REPOSITORY"
        auth="Container"
        type="javax.sql.DataSource"
        factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
        username="<username>"
        password="<password>"
        driverClassName="<driverClassName>"
        url="<url>"
        maxTotal="100"
        minIdle="10"
        maxIdle="25"
        initialSize="10"
        validationQuery="<validationQuery>"
        rollbackOnReturn="false"
        enableAutoCommitOnReturn="false"
    />
</Context>

Note

By configuring the JNDI data source, you’re instructing EBX® to use that JDBC connection method. Consequently, EBX® will no longer consider environment variables beginning with 'EBX_DB_'.

Adding a driver for the Metadata database

Adding a driver for the Metadata database requires installing the corresponding Python module. The Python module must be installed within the Python virtual environment, which requires activating the virtual environment beforehand.

Here is an example of how we can customize the Docker image to add the driver for the PostgreSQL database:

FROM ebx:6.2.2
USER root

WORKDIR /opt/ebx/classifier/app/src

# activate the virtual environment and install the Python module
RUN . .venv/bin/activate && pip3 install psycopg2-binary==2.9.9

USER ebx

See SQLAlchemy dialects for more information about the database drivers that can be used with SQLAlchemy.

Documentation > Administration Guide > EBX® Container Edition