[17.0.0.3 and later]

Upgrading the license to use custom Docker containers

If you want to build your own image stack for Liberty, for example, by modifying the operating system of the container, then you must complete this task before you deploy your customized image into IBM Cloud Private.

About this task

The IBM Cloud Private bundles available from Passport Advantage Online provide a production license for Liberty Docker containers, which are ready to be used as the base image.

Use this task to upgrade the license so that you can modify your Liberty Docker containers that are deployed in IBM Cloud Private. Run the commands in this task in the same directory as the license JAR and your Dockerfile, which is what builds the Docker image.

Procedure

  1. Download the appropriate license.
  2. Expose that license that you downloaded by using a simple web server. Use a nginx container to expose the license:
    docker run -dP --name jar_server -v $(pwd):/usr/share/nginx/html nginx
    jar_server_ip=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' jar_server)
    jar_url="http://${jar_server_ip}:80/wlp-core-license.jar"
    Note: You must replace core with base or nd, if you downloaded those licenses.
  3. Add the following lines to your Dockerfile to complete the upgrade:
    Note: These lines of code assume that Liberty is installed inside the /opt/ibm directory in the container and add the appropriate label to identify this container as a Liberty container.
    LABEL "ProductID"="fbf6a96d49214c0abc6a3bc5da6e48cd" \
          "ProductName"="WebSphere Application Server Liberty" \
          "ProductVersion"="17.0.0.3"
    
    ARG LICENSE_JAR_URL
    RUN \ 
      if [ $LICENSE_JAR_URL ]; then \
        wget $LICENSE_JAR_URL -O /tmp/license.jar \
        && java -jar /tmp/license.jar -acceptLicense /opt/ibm \
        && rm /tmp/license.jar; \
      fi
  4. Enter the following argument to run the code from the previous step and build your container:
    docker build --build-arg LICENSE_JAR_URL=$jar_url
  5. Remove the deployed nginx container.
    docker rm -f jar_server

Results

Now your container is licensed and labeled to run inside IBM Cloud Private.

Icon that indicates the type of topic Task topic

File name: twlp_icp_license.html