(v9.0.0.2)

Docker container start up logic for 9.0.0.2 or later

When we deploy a container from an IBM provided image, an Entrypoint.sh helper script determines the configurations to use while starting up the container. Review the following information to learn about what the helper script does, and how we can customize the configurations.

By understanding the start up process of these Docker containers, we can learn how to customize the configurations to meet your needs and integrate with the container infrastructure to support your production environment. This information is also important if you choose to build a continuous integration and continuous deployment (CI/CD) pipeline to streamline the deployment process. Your pipeline needs to be able to retrieve these environment configuration values and pass the values to each Docker container that is started.


Local Docker container start up help documents

We can access quick help documents on the machine where the Docker images are loaded. See Accessing Docker image Help. Continue reading to get a more comprehensive understanding of the start up logic and to learn how to customize the containers.


WebSphere Commerce default configurations

IBM provided Docker images have embedded default configurations so that we can quickly deploy a runtime environment by only making minimal changes to the Docker image. If you do not use the default Docker container host names or database information, then ensure that you pass in the necessary parameters during container start up. First, here are the default configuration values.


Docker start up flow diagram

The following diagram illustrates the underlying logic and commands that run when you start a container. IBM defines a unique /SETUP/bin/entrypoint.sh script as the Docker image ENTRYPOINT to specify start up commands and configurations. For more information about ENTRYPOINT, see Dockerfile ENTRYPOINT. The following diagram is a visual representation of the start up logic.

  1. entrypoint.sh first checks for license acceptance. All containers require LICENSE=accept to be passed in order to start.

  2. If set any custom configurations before the IBM logic starts, we can create a preConfigure.sh script and save it to the /SETUP/bin/ directory of the Docker image. For example, to retrieve key-value pairs from a remote configuration management center other than Vault, then you need to customize the /SETUP/bin/preConfigure.sh script to connect to your configuration management center.

  3. Determine how to pass Docker start up parameters.

    1. If you do not use Vault, we can specify CONFIGURE_MODE=EnvVariables. This triggers the /SETUP/bin/envVariablesConfigure.sh script and pulls parameters from the container environment variables.

    2. WebSphere Commerce Docker images are configured to support Vault as a configuration management center. If you set up your parameters in Vault, we can specify CONFIGURE_MODE=Vault. This triggers the /SETUP/bin/vaultConfigure.sh script that can pull parameters from the Vault as long as you provide the VAULT_TOKEN and VAULT_URL.

      • The script needs each Docker service host name to contain the <TENANT>/<ENVIRONMENT>/<ENVTYPE>/<TARGET_KEY> values, and environment-related configuration data must be organized as <TENANT>/<ENVIRONMENT>/<ENVTYPE>/<TARGET_KEY>. For more information about how to organize your data in Vault, see Environment data structure in Consul/Vault.

      • This method is designed to support multi-tenant environments on Docker orchestration platforms. It is best used in a CI/CD pipeline where you have the ability to resolve the TENANT, ENVIRONMENT, ENVTYPE, and STOREWEB_HOST parameters.

      • This method follows a fixed pattern to set each container's host name during container start up. For example, the Transaction server container host name is set as <TENANT><ENVIRONMENT><ENVTYPE>tsapp.<DOMAIN-NAME>

    3. To quickly deploy an environment with minimal changes, we can omit the CONFIGURE_MODE parameter and specify values as container environment variables. This method only supports some parameters so customization is limited in this mode.

    Also, if you configured Vault as a certificate authority with a PKI back end, then we can also pass VAULT_CA=true. This triggers the /SETUP/bin/updateCerts.sh script to configure internal certification between Docker containers. See Manage certificates with Vault.

  4. Next, entrypoint triggers the /SETUP/bin/postConfigure.sh script, which allow for another point of customization where we can customize any aspect of the Docker container start up logic.

    • If we are handling certificates locally and not using Vault, we can define your certificate information in a JSON file and save it to /SETUP/certs/custom. The /SETUP/bin/updateLocalCerts.sh script looks in the /SETUP/certs/custom directory and loads all JSON files. For more information, see Manage certificates manually.

    • To customize any start up logic scripts, we can create a /SETUP/bin/postConfiguration.sh script to include our own logic. This is the last script to run during container start up. Any configurations that you specify in postConfiguration.sh supercede any configurations from previous scripts. For example if the /SETUP/bin/vaultConfigure.sh, /SETUP/bin/envVariablesConfigure.sh, or /SETUP/bin/updateLocalCerts.sh scripts do not meet your requirements, it is recommended that we use those scripts as a starting point. Follow the same skeleton and update or add any custom logic into the postConfiguration.sh script.

Tip: To add any of our custom files to the Docker image (preConfigure.sh, postConfiguration.sh, *.json), create a Dockerfile and define a COPY instruction to copy the file into the new target location of the Docker image. Then use the Dockerfile to build a custom Docker image.


Viewing help and license information

We can run the following commands without starting the container.

We can also read the /SETUP/bin/entrypoint.sh script to understand the start up logic.


Start containers with varies configuration options

Each WebSphere Commerce Docker container has its own mandatory parameters that you need to provide for the container to start. There are also optional parameters that we can specify to further customize the container. See the following topics.