Containerization builds an OCI image from discovered artifacts and produces a deployment file you can use to deploy in the TKG cluster or any Kubernetes cluster.

Application Transformer for VMware Tanzu supports Tomcat Containerization on different versions.
Tomcat Version Base OS JRE/JDK Version
9.0.45 Ubuntu 20.04 JDK-11.0.16
9.0.46 oracleLinux8 JRE-1.8.0_291
9.0.46 oracleLinux7 JRE-1.7.0_21
9.0.46 oracleLinux8 JDK-9.0.4
10.0.6 oracleLinux8 JRE-1.8.0_291
8.5.69 oracleLinux7 JRE-1.8.0_291
9.0.46 centos7 JDK-9.0.4
9.0.46 centos7 JRE-1.8.0_291
9.0.45 rhel7 JRE-1.8.0_322
9.0.45 rhel7 JDK-9.0.4

Prerequisites

Procedure

  1. Refer the current versions of Tomcat, JRE/JDK and select the desired versions for image.

    If you specify photon:latest, add the below package for useradd command.

    RUN tdnf -y install shadow
    Note: You must have internet connection or you must have a proper base image with required packages installed on it.
  2. Select the Source Registry to pull the base image, which can be embedded harbor registry, enterprise harbor registry or docker registry.
  3. Select the Base OS for image.
    By default, VM operating system is populated.
  4. Click Continue.
    Under Web Applications, you see the list of all applications present in the Tomcat Server.
  5. Select the application you want to containerize.
    You can select more than one application. To containerize all applications present in Tomcat, select the check box on the table header.
  6. If you have selected only one application or only a few applications to containerize, you must update the configuration files in the conf and bin directories.
    Note: Ignore this step if you have selected all applications for containerization.
    1. Click DOWNLOAD.
    2. Unzip the directory files.
    3. Update the files according to your requirement.
    4. Zip the directory files that contains the updated configurations.
    5. Click UPLOAD to upload the updated conf or bin directory in the ZIP format.
  7. Click Continue.
  8. Review the docker file and update the file, if required.
    Note:
    • You can change the user and group.
      Arg User=tomcat
      Arg Group=tomcat
    • Application Transformer for VMware Tanzu creates the folder structure similar to source VM for CATALINA_HOME. If this folder is a different folder like /root, then you must change the user permissions appropriately in the docker file before containerization. Otherwise, it might cause permission issues while deploying the image.
    • You can copy the missing directories from the source VM to the image.

      COPY --chown=$USER:$GROUP webapps &CATALINA_HOME/webapps/

  9. Review the default entry point details and update, if required.
  10. Click Continue.
  11. Select the destination registry.
  12. Enter a proper image tag in the <repository>/<image>:<tag> format to push the image and artifacts.
  13. Click Continue.
  14. Review the selections and click CONFIRM to trigger the Build Image task.

Results

  • An alert pops-up showing the status of the operation. Build Image Task can be tracked in the Tasks page. Click on the task within the task bar to view the logs associated with the build process.
  • After successful completion of image build and push, component details are updated with OCI image tag and artifact tag. Artifacts zip can be downloaded and contains all discovered artifacts from the domain and generated template deployment yaml file which needs to be edited to replace FIX-ME details before deploying.

What to do next

Deploy the image in the Tanzu Kubernetes Grid cluster.