Configure central database access to the Utility Docker container

Centralized configuration of database access information allows utilities to run without having to directly specify login and other information. Using this feature, the Utility Docker container will have the information available after being created.


Task info

After database access information is centralized using this feature, every Utility Docker container created will have the database information built into it. The startup process involves:

  1. Collecting the database access information.

  2. Placing the database access information in the following file:

      /opt/WebSphere/CommerceServer90/xml/config/alldbconnector.xml

After this startup process is complete, the database access information will be available to each utility that uses that file. There can be multiple such database profiles created in this way. Each profile consists of a JDBC URL, a user and a password, and is associated with a database type (DB2 or Oracle). There is always a profile called "default". Here is an example of how a database profile is defined in alldbconnector.xml:

This database information must be available to the Utility Docker container at the time of its creation. There are three ways that the information can be made available: via Vault; through the config.properties file; or as environment variables within the Docker image itself. The configUtility.sh process will try to search for the variables in the following sequence:

  1. First, it checks for the environment variables which signal that the container is setup with Vault: VAULT_TOKEN, VAULT_URL, TENANT, ENVIRONMENT, ENVTYPE. If these are present, the database access information will be retrieved from Vault. Note that the process will not use other methods for obtaining the database access information. Therefore, if one database profile is in Vault then all need to be in Vault.

  2. If the Vault environment variables are not available, the process will attempt to retrieve the database access information from environment variables.

It then writes the data to allDBConnector.xml.


Procedure

Adding database login variables to the Vault

Adding profile information as environment variables

What to do next

There are numerous parameters that we can use when starting a new Docker container. For more information, see Docker container start up logic for 9.0.0.2 or later.


Related tasks
Configure database connections in Docker images


Related reference
runSQL utility