Oracle

Building custom Docker images for use with an Oracle database

By default, when you deploy HCL Commerce Docker containers, the containers are configured to connect to an IBM Db2 database that is named mall, with a database user name wcs. If your database type is different, then you must update the Docker containers to contain the required driver.

Before you begin

Obtain the Oracle JDBC driver java/ojdbc8.jar, from the Oracle installation folder.

About this task

In this procedure, you create new Docker images that include the Oracle JDBC driver that is required to connect to the Oracle database. This inclusion is only made to the specific containers that connect with the database.
Specifically, the containers that require this driver are:
  • The Transaction server.
  • The Search server (For Solr and NiFi connections, depending on the search solution that is used).
  • The Utility server.

Procedure

  1. Add the Oracle driver to the required containers.

    Add the following lines to each Dockerfile script.

    The COPY command copies the Oracle JDBC driver to the specified directory within the customized Docker image.
    1. Transaction server
      COPY ojdbc8.jar /SETUP/driver/oracle/
    2. Search server (Solr-based search solution)
      COPY ojdbc8.jar /opt/WebSphere/Liberty/usr/shared/resources/
    3. NiFi Search server (Elasticsearch-based search solution)
      COPY ojdbc8.jar /opt/nifi/nifi-current/lib/
    4. Utility server
      COPY ojdbc8.jar /SETUP/driver/oracle/ojdbc8.jar
      COPY ojdbc8.jar /opt/WebSphere/CommerceServer90/lib/ojdbc8.jar
  2. Build the customized Docker image.
    docker build -f /path/to/Dockerfile .
    The custom Docker images, containing the required driver, are generated.

Results

Your custom HCL Commerce Docker images now include the required driver to connect to an Oracle database. If your organization uses a Docker Registry, you can tag and and push the customized Docker images to it. When HCL Commerce is deployed from it, they will contain the necessary driver to connect to your database.