Customizing images with om-base image
Customizing with the om-base image involves creating a custom runtime
container, applying customizations related to APIs, databases, or the user interface, and modifying
database properties as needed. The process of customization using the om-base image
is also referred to as the customization runtime.
Before you begin
- Ensure that the Docker or Podman is installed on the host machine and you have appropriate permissions to run Docker or Podman commands.
- Pull the
om-baseimage into the local Docker repository.
Procedure
- From the base image, create a custom runtime container with a shared directory, which is
mounted from the host file system.
- Run the following Docker or Podman commands:
- Docker
-
docker volume create <oci-storage-name> docker run -e LICENSE=accept -e LANG --privileged -v <oci-storage-name>:/images \ -v <docker volume or host path>:/opt/ssfs/shared -it --name <container name> <image> bash
- Podman
-
sudo podman volume create <oci-storage-name> sudo podman run -e LICENSE=accept -e LANG -v <oci-storage-name>:/images \ -v <docker volume or host path>:/opt/ssfs/shared -it --name <container name> <image> bash
Here,
- <oci-storage-name> refers to the container volume that can be used for storage by
buildah. - <docker volume or host path> is an optional parameter that refers to the file system directory path or a docker volume that is mapped and shared with the container. The corresponding container path is /opt/ssfs/shared.
- <container name> refers to the name of the container.
- <image> refers to the
om-baseimage. For example,cp.icr.io/cp/ibm-oms-<edition>/om-base:<image tag>.
Docker example:docker volume create oms-images docker run -e LICENSE=accept -e LANG --privileged -v oms-images:/images \ -v /path/to/oms-shared:/opt/ssfs/shared -it --name om-cust-container cp.icr.io/cp/ibm-oms-<edition>/om-base:10.0.0.21-amd64After the commands run successfully, a container is created and you are directed to the shell environment of the container.
- The application licenses are present in the
/licensesdirectory within the image. - In case you exit from the shell environment of the container and want to again enter the shell
environment of the container, run the following command:
- For
Docker,
docker start <container name> && docker exec -it <container name> bash - For Podman,
sudo podman start -a <container name>
- For
Docker,
- It is recommended that you generate a new
om-baseimage from the customized runtime so that the sameom-baseimage can be used for developing further customizations.
Note: To minimize the base image size, certain large directories and files in the runtime are compressed. These files are extracted when the container is created, which occurs when the entrypoint script is executed.Starting from version 10.0.2406.0 and later, if the Docker image is built using a Dockerfile fromcp.icr.io/cp/ibm-oms-enterprise/om-base, run the following command to extract the required directories and files into the runtime.RUN tar -xzf /opt/ssfs/runtime/archive.tar.gz -C /opt/ssfs/runtime/ && rm -f /opt/ssfs/runtime/archive.tar.gz
- Run the following Docker or Podman commands:
- Review the following information before proceeding to next steps.
- If you are using an image from fix pack 10.0.0.26, 10.0.0.29, or 10.0.2206.0, ensure to re-apply the appropriate fix pack in order to get the fix pack factory setup files.
- Ensure that the database schema is created before providing the database details for the customization runtime.
- If you are customizing Sterling™ Order Management System Software beyond generating images, update the sandbox.cfg properties and other applicable properties.
- Navigate to
<runtime>/binand run the./setupfiles.shcommand to ensure the changes are updated.
- Enable OIDC support by adding the following property to the
/opt/ssfs/runtime/properties/sandboxfile. For more information, see Supporting OIDC provider login in Operator.ENABLE_IBMID_AUTHENTICATION=true - Configure the database properties.
- Multischema mode
-
If you want to configure your database, Oracle, Db2, or PostgreSQL with multischema, see Transforming containers for multischema. Then, configure the properties for the database that you are using. The Jdbc schema, URL, user, and password must be metadata information of multischema.
- Single schema mode
-
- Db2
- Complete the following steps if you are using Db2. By default, the base runtime contains Db2 drivers.
-
- Configure the database connectivity by updating
system_overrides.properties. - Go to the /opt/ssfs/runtime/properties folder.
- Create the
system_overrides.propertiesfile and add the Db2 properties. For more information, see Db2 properties. - Ensure none of the applications or agents are running against the same database when you are performing any database-related operations from the customized runtime.
- Configure the database connectivity by updating
- Oracle
- Complete the following steps if you are using Oracle.
- Copy Oracle jar to the container.
- Browse to the <runtime>/bin folder and install the Oracle driver by
running the following
commands:
./install3rdParty.sh <vendorName> <vendorVersion> -d <path to ojdbc8.jar> -targetJVM EVERY./install3rdParty.sh <vendorName> <vendorVersion> -j <path to ojdbc8.jar> -targetJVM EVERY - Browse to the /opt/ssfs/runtime/properties folder.
- Add or modify the Oracle properties in
sandbox.cfgfile. For more information, see Oracle properties.For more information about the
sandbox.cfgproperties, see the Sandbox.cfg properties. - Browse to the <runtime>/bin folder and run the
./setupfiles.shcommand.
- PostgreSQL
-
- Download and copy PostgreSQL driver that is
postgresql-42.2.24.jarto the container with the namepostgresql.jar. - Browse to the <runtime>/bin folder and install the PostgreSQL driver by
running the following
commands:
./install3rdParty.sh <vendorName> <vendorVersion> -d <path to postgresql.jar> -targetJVM EVERY./install3rdParty.sh <vendorName> <vendorVersion> -j <path to postgresql.jar> -targetJVM EVERY - Browse to the /opt/ssfs/runtime/properties folder.
- Add or modify the PostgreSQL properties in the
sandbox.cfgfile. For more information, see PostgreSQL properties.Note:- If you want to transform your containers to a new database type, setting up the database transformation properties are mandatory.
- The Sterling Order Management System Software Operator injects database connection properties automatically during deployment. Therefore, if you are using the customization container only to generate custom images, setting up the database connection properties is optional.
For more information about the
sandbox.cfgproperties, see the Sandbox.cfg properties. - Browse to the <runtime>/bin folder and run the
./setupfiles.shcommand.
- Download and copy PostgreSQL driver that is
- Verify that the database connection is established by completing the following
steps:
- Go to <runtime>/bin
- Run
./dbverify.sh
- Load the base factory setup to load the factory setup data.
- Load the fix pack factory setup present in the
om-baseimage or apply the latest fix pack. For more information, see Installing fix pack for Sterling Order Management System Software containers. - To apply any user interface customizations in the Sterling Business Center, see Customizing Sterling Business Center images.
- Optional: By default, the runtime does not contain Javadoc. If you want to
build Javadoc, run the following command.
./sci_ant.sh -f ../properties/xapiDeployer.xml alldocsFor 10.0.0.17 or laterom-baseimage, use generate images script to generate Javadoc and an image that can be deployed. Navigate to/opt/ssfs/runtime/container-scripts/imagebuildfolder, and run the following command:./generateImages.sh --MODE=docs --EXPORT=falseThis command generates a new image with the nameom-app-docs. You can push this image to the cluster and deploy for accessing Javadoc. For more information about deploying multiple application images, see the Deploying smcfsdocs. - Optional: Apply language packs manually only for the images of FP23 or older.
The images of FP26 and later comes with language packs applied by default. The supported language
packs are available as an archive at
/var/opt/ssfs/LP.tgz.tar -xf /var/opt/ssfs/LP.tgz -C /opt/ssfs/runtime