Docker container start up logic for 9.0.0.0 and 9.0.0.1

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.


Default configurations 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 ENTRYPOINT calls the /SETUP/bin/configure.sh script. This script defines the IBM default configurations used to start the Docker containers. Each container has its own configure.sh script.


1 Starting containers

IBM provided Docker images have embedded default configurations so that we can quickly deploy a runtime environment without making any changes to the Docker image. Here are examples of how to start containers with all default settings by using native Docker commands.

To read about the license terms and agreements, we can run

Where <lang_alias> is the language to read. Valid values are cs/de/el/en/es/fr/in/it/ja/ko/lt/pl/pt/ru/sl/tr/zh_TW/zh.

The <encrypted_merchant_key> is the encrypted key that is created during database schema initialization. See Loading the WebSphere Commerce database schema.

The <encrypted_spiuser_pw> is the encrypted password for the user 'spiuser'. See Setting the spiuser password in our Docker images. Here are the configuration values that are set by default.

Note: To learn how to start containers and deploy environments by using Docker Compose, see
Deploy a WebSphere Commerce environment locally.


2 Setting configuration parameters

By default, there is a /SETUP/bin/configure.sh script in each Docker container. Each script defines the IBM default configurations used to start that specific container. Use this default configuration logic as a reference to set our own configurations. The script is designed to be able to fetch container start up parameters from Vault. The script needs each Docker service host name to contain the{tenant}{environment_name}{env_type} values, and environment-related configuration data must be organized as {tenant}/{environment_name}/{env_type}/{target_key}. There are two methods to overriding the default configuration:


2.1 Setting configuration parameters method 1 (create new scripts)

If you do not use Vault or set some specialty configurations (such as connections to a configuration management system other than Vault), then create a /SETUP/bin/preConfigure.sh or /SETUP/bin/custConfiguration.sh script. Copy contents from /SETUP/bin/configure.sh into the new scripts, modify based on your requirements, and rebuild the Docker image. With this customized Docker image, the start up logic automatically triggers the preConfigure.sh or custConfiguration.sh scripts if the files exist. The preConfigure.sh script runs before the custConfiguration.sh script. Depending on our customization needs, we can decide to use both or only one of the scripts.

Note: This method is best used in a local, single server, or simple authoring/production environment system that does not leverage Docker orchestration tools that you would use in a CI/CD pipeline scenario. Also, any environment configurations that we define in this custConfiguration.sh file supersedes any other configurations that we might make since this is the last script to run. If you use this method, you do not have to specify OVERRIDE_PRECONFIG=true when you start the container.


2.2 Setting configuration parameters method 2 (OVERRIDE_PRECONFIG=true)

We can add the container environment parameter 'OVERRIDE_PRECONFIG=true' when you start a container. This parameter causes the start up process to execute logic to override the default values (from configure.sh) with values that you provide. Now, how do you provide our own values when you specify OVERRIDE_PRECONFIG=true?

There are mandatory and optional parameters that you need to provide to the containers. If you do not set these mandatory parameters, the container will not start. For more information about the configuration parameters, see Docker container start up configuration parameters.

Note:


3 Handling certificates

There are two types of certificates that are supported by the IBM provided Docker images; internal certificates between each running container and external certificates for third-party integrations.


4 Additional Configuration

As you customize WebSphere Commerce, we might realize that you need to implement additional custom logic. The Docker images contain a postConfiguration.sh script that calls two actions:


Related reference
WebSphere Commerce runtime environment overview
Docker container start up configuration parameters


Related information:

Implement a continuous deployment pipeline for WebSphere Commerce Version 9