Deploy updated Docker images

Updates for WebSphere Commerce runtime environments are delivered as new Docker images. After you update the runtime environment, download the new images, and rebuild the images to include custom code, you then deploy new containers.


Before starting

Ensure that your private Docker registry is updated with the latest Docker images and Run the updatedb utility to update the database.


Procedure

  1. Stop existing containers. For example, if we are using Docker Compose,

      docker-compose -f <path_to_compose_yml> stop

  2. Remove existing containers. For example, if we are using Docker Compose, run one of the following commands.

    • If the database is running in a Docker container and the container is defined in our Docker Compose YML file, remove all containers except for the database container. If you remove the database container, then you lose your data. For example,

        docker-compose -f <path_to_compose_yml> rm txn store search web xc utils

    • If the database is not running in a Docker container, then we can use the following command.

        docker-compose -f <path_to_compose_yml> rm

  3. Deploy new containers based on the updated Docker images. For example, if we are using Docker Compose, complete the following sub steps.

    1. Open your existing Docker Compose YML files that we used to deploy the runtime environments.

    2. Update the image path in the YML file to point to the new Docker image. For example, for the Transaction server Docker image (ts-app), if you tagged the updated image as 9.0.0.1,

      Deploy with Docker Compose
      Example
      If we are pulling images from our organization's private Docker registry

        image: <Private_Docker_registry>/library/ts-app:9.0.0.1

      If you used docker load to load the Docker images locally

        image: commerce/ts-app:9.0.0.1

    3. Run the following command to pull the new images and deploy new containers.

        docker-compose -f <path_to_compose_yml> up -d

  4. Verify that the containers are updated.

    1. Run the following command.

        docker ps

      Ensure that the Docker container tags are the same as the tag that we defined in your YML file.

    2. Enter each container and run the viewlabels command. For example,

        docker exec -it <container_name> bash
        /SETUP/bin/viewlabels

      Ensure that all container labels have the same date stamp, such as 9.0.0.5. .

  5. Update the database to the latest WebSphere Commerce database schema.

    1. Back up the database. We need to back up because if you ever uninstall an update, you need to also restore the database to the earlier version. For more information about how to back up, see BACKUP DATABASE COMMAND.

    2. Update the wcs.9.0.0.2.bootstrap.xml file. IBM is aware of an issue with an XML file in the Version 9.0.0.2 Update Package that causes the updatedb utility to fail. The fix will be resolved in the next update. Complete the following steps to immediately fix the issue and finish the update to Version 9.0.0.2.

      1. Enter the Utility server Docker container and open the /opt/WebSphereCommerceServer90/schema/data/xml/9.0.0/wcs.9.0.0.2.bootstrap.xml file for editing.

      2. Wrap the contents of the file with <import> </import>.

      3. Save the file.

    3. Run the updatedb utility to update the database.