Use the preconfigured Db2 Docker image in a runtime environment

Rather than install Db2 and manually configure the database to use with WebSphere Commerce, we can simply launch the preconfigured Db2 Docker image as your test database.

This Db2 Docker container must be used for test purposes only. Under no circumstance can this Docker image be used as the staging or production database.


Before beginning

  1. Download the latest WebSphere Commerce Version 9 Docker images. Included in these images is the Db2 Docker image.

  2. Extract the Db2 Docker image to a desired directory.

  3. If we are using Centos 7, with the default store driver overlay, change the default storage driver to devicemapper. The Db2 Docker image does not support the overlay storage driver. For more information about confuting the store driver in Docker, see Configure Docker with the devicemapper storage driver.


Procedure

  1. Launch the preconfigured Db2 Docker image:

      docker run -d -e LICENSE=accept --privileged -p 50000:50000 db2-docker-image

  2. Verify that the Db2 instance is running in one of two ways:

    • Use the Db2 client to connect to the Db2 service.

    • Log on to the Db2 container to connect to the Db2 instance:

        * docker exec -it db2ContainerId /bin/bash
        * su - db2inst1
        * db2 connect to mall user wcs using wcs1

      Where db2ContainerId is the Db2 container ID.


What to do next

Deploy WebSphere Commerce Runtime.
Next topic: Installing the IBM Db2 database