Creating Docker image for SP Workload

The SP workload or Service Portal workload is a different workload from other IBM® Control Desk components. It is not created using the ear/war file process but using the service portal installation. It uses node as a base server and standard Service Portal installation is required for creating this image.

Procedure

  1. Install Service Portal in your admin workstation using standard installation procedure. It will create a directory C:\<IBM>\<ICD>\service_portal for your installation content.
  2. Go to c:\icd-docker-files and create a sub-directory icd-sp.
  3. Create 3 sub-directories inside icd-sp and name them as files, ng, and bin.
  4. Copy content of C:\<IBM>\<ICD>\service_portal inside ng sub-directory.
  5. Copy the certificate files inside the files sub-directory.
    Note: You must use your own certificate files here.
  6. Create a file entrypoint.sh inside bin sub-directory. Below are the contents:
    # default values
    [ -n "$MAXIMO_HOST" ] || export MAXIMO_HOST=localhost
    [ -n "$MAXIMO_PORT" ] || export MAXIMO_PORT=9080
    [ -n "$SECURE" ] || export SECURE=false
    
    # set SCCD_URL through host and port if not set
    if [ -z "$SCCD_URL" ]; then
      [ "$SECURE" == "true" ] && protocol=https || protocol=http
      export SCCD_URL="$protocol://$MAXIMO_HOST:$MAXIMO_PORT"
    fi
    
    cd $SSP_HOME
    exec "$@"
    
  7. Create a Dockerfile inside c:\icd-docker-files\icd-sp. Below are the contents:
    FROM node:10.22.0
    
    # environment variables
    ENV SSP_HOME /opt/ibm/ng
    ENV PORT 3000
    ENV MAXIMO_HOST localhost
    ENV MAXIMO_PORT 9080
    ENV SCCD_REST_CONTEXTROOT maximo
    ENV SCCD_CONTEXTROOT maximo
    
    # copy the serviceportal tree into the ng directory
    USER root
    RUN mkdir -p $SSP_HOME
    COPY ng $SSP_HOME
    
    # copy the certificate and key
    COPY files $SSP_HOME
    
    COPY bin /
    
    # expose 3000
    EXPOSE 3000
    
    # start serviceportal
    ENTRYPOINT [ "/bin/bash", "entrypoint.sh" ]
    CMD [ "node", "/opt/ibm/ng/app.js"]
    
    The base image is Node version 10.22.0 and environment variables are set. The content of the ng directories are copied inside the container and entrypoint.sh is called.
    The node server is started at the end.
  8. Use the Docker build command to build the image.
    docker build -t icd/sp:<7612>.
    Below table describes the docker images to be built and their base files.
    Table 1. ICD components
    ICD Images Base Image ICD Version
    Icd:base websphere-liberty: latest NA
    icd/ui:<7612> icd:base ICD <7612>
    icd/api:<7612> icd:base ICD <7612>
    icd/cron:<7612> icd:base ICD <7612>
    icd/report:<7612> icd:base ICD <7612>
    icd/mea:<7612> icd:base ICD <7612>
    icd/sp:<7612> node:10.22.0 NA
    icd/jms:<7612> websphere-liberty NA