Setting Up ThingWorx Docker Builds
To build ThingWorx Docker images, perform both of the following actions:
Make sure the required binaries are staged and available for the build process.
Modify the build.env variable file with appropriate values.
* 
In this topic, <n-n-n> is used to denote the release version as <major-minor-maintenance>.
Required Files
The following files are required to build ThingWorx Docker. Details on how to obtain these files are available in the Staging Files section of this topic. For compatibility information on Apache Tomcat and Java with the current ThingWorx version, check out the Release Advisor.
Required files for all platform versions:
Platform
Required File
Example File
template-processor
A tool provided by PTC to both parse templates inside the Docker container when it is starting to provide variables and format configuration files based on the running environment.
template-processor-12.0.0.9-application.tar.gz
tomcat
The Tomcat archive file obtained from Apache to run the ThingWorx Platform.
tomcat-9.x.x.tar.gz
java
The OpenJDK - Amazon Coretto file obtained from Amazon Web Services or the Java JDK version 11 archive file obtained from Oracle.
amazon-corretto-11.x.x-linux-x64.tar.gz
jdk-11.x.x-linux-x64_bin.tar.gz
Required archive files for the individual platform versions:
* 
If you download a file from the PTC Support site, the downloaded file will be named similar to MED-12345-CD-084_ThingWorx-Platform-H2-8-4-0.zip. The scripts assume Thingworx-Platform-type-version.zip.
Platform
Example File
ThingWorx Platform H2
Thingworx-Platform-H2-<n-n-n>.zip
ThingWorx Platform PostgreSQL
Thingworx-Platform-Postgres-<n-n-n>.zip
ThingWorx Platform Microsoft SQL Server
Thingworx-Platform-Mssql-<n-n-n>.zip
This version also requires the Microsoft JDBC Driver for SQL Server from Microsoft.
sqljdbc_7.4.1.0_enu.tar.gz
ThingWorx Platform Azure SQL
Thingworx-Platform-Azuresql-<n-n-n>.zip
This version also requires the Microsoft JDBC Driver for SQL Server from Microsoft.
sqljdbc_7.4.1.0_enu.tar.gz
build.env Variables
The build.env file contains a list of variables that you must set. The following variables must be set:
Variable Name
Default
Comment
BASE_IMAGE
1. ThingWorx 9.0 through 9.3
2. ThingWorx 9.4 and up
1. ubuntu:20.04
2. ubuntu:22.04
Specifies the Ubuntu version to use as base image.
JAVA_VERSION
11.0.10.9.1
Specifies the version of the Amazon Coretto OpenJDK.
JAVA_ARCHIVE
amazon-corretto-11.0.10.9.1-linux-x64.tar.gz
jdk-11.0.10_linux-x64.tar.gz
Specifies the name of the Java archive file in the staging folder.
TOMCAT_VERSION
9.0.43
Specifies the version of Apache Tomcat.
TEMPLATE_PROCESSOR_VERSION
12.1.0.13
Specifies the version of the template-processor archive file in the staging folder.
PLATFORM_SETTINGS_FILE
platform-settings.json
Specifies the path to a base ThingWorx settings file (included in the staging folder).
BUILD_TEST_DBS
true
Determines whether to build database images for testing, alongside the platform images. Set to true to build the database images.
PLATFORM_H2_VERSION
<n-n-n>
Specifies the version of the ThingWorx H2 Platform to build. Only required when building H2 containers.
PLATFORM_H2_ARCHIVE
Thingworx-Platform-H2-<n-n-n>.zip
Specifies the file name of the ThingWorx H2 .zip file in the staging folder. Only required when building H2 containers.
PLATFORM_POSTGRES_VERSION
<n-n-n>
Specifies the version of the ThingWorx PostgreSQL Platform to build. Only required when building PostgreSQL containers.
PLATFORM_POSTGRES_ARCHIVE
Thingworx-Platform-Postgres-<n-n-n>.zip
Specifies the file name of the ThingWorx PostgreSQL .zip file in the staging folder. Only required when building PostgreSQL containers.
PLATFORM_MSSQL_VERSION
<n-n-n>
Specifies the version of the ThingWorx Microsoft SQL Server Platform to build. Only required when building Microsoft SQL Server containers.
PLATFORM_MSSQL_ARCHIVE
Thingworx-Platform-Mssql-<n-n-n>.zip
Specifies the file name of the ThingWorx Microsoft SQL Server .zip file in the staging folder. Only required when building Microsoft SQL Server containers.
SQLDRIVER_VERSION
7.4.1.0
Specifies the version to install of the Microsoft JDBC Driver for SQL Server. Only required when building Microsoft SQL Server containers.
PLATFORM_AZURESQL_VERSION
<n-n-n>
Specifies the version of the ThingWorx Azure SQL Platform to build. Only required when building Azure SQL containers.
PLATFORM_AZURESQL_ARCHIVE
Thingworx-Platform-Azuresql-<n-n-n>.zip
Specifies the file name of the ThingWorx Azure SQL Server .zip file in the staging folder. Only required when building Azure SQL containers.
AZURESQL_SQLDRIVER_VERSION
7.4.1.0
Specifies the version to install of the Microsoft JDBC Driver for Azure SQL. Only required when building Azure SQL containers.
The following variables must be set only if the default values do not match the files in the staging folder:
Variable Name
Default
Comment
TOMCAT_ARCHIVE
tomcat-${TOMCAT_VERSION}.tar.gz
Specifies the name of the Tomcat archive file in the staging folder.
JAVA_ARCHIVE
${JAVA_VERSION}-linux-x64.tar.gz
Specifies the name of the Java archive file in the staging folder.
SQLDRIVER_ARCHIVE
sqljdbc_${SQLDRIVER_VERSION}_enu.tar.gz
Specifies the name of the Microsoft JDBC Driver for SQL Server archive file in the staging folder. Only required when building Microsoft SQL Server containers.
AZURESQL_SQLDRIVER_ARCHIVE
sqljdbc_${AZURESQL_SQLDRIVER_VERSION}_enu.tar.gz
Specifies the name of the Microsoft SQL JDBC archive file in the staging folder. Only required when building Azure SQL containers.
TEMPLATE_PROCESSOR_ARCHIVE
template-processor-${TEMPLATE_PROCESSOR_VERSION}-application.tar.gz
Specifies the name of the template-processor archive file in the staging folder.
SECURITY_TOOL_ARCHIVE
security-common-cli-${SECURITY_TOOL_VERSION}-application.tar.gz
Specifies the name of the security tool archive file in the staging folder.
Staging Files
You must place the required files for building the Docker images in the staging folder that is part of this release. The staging folder should already contain a base platform-settings.json file.
To assist with staging, Apache Tomcat and the configured version of the Microsoft JDBC Driver for SQL Server (the default version) can be downloaded automatically.
To download automatically:
1. Make sure you have set the build.env file variables appropriately.
2. Run the command ./build.sh stage.
If there are no errors, the files should be in the staging folder and they should match your build.env settings.
You can get the other required files in the following ways:
Java
Download a supported version of Java 11 from any of the following locations:
Downloads for Amazon Corretto 11: Download the Linux x64 tar.gz file (for example: amazon-corretto-11.x.x-linux-x64.tar.gz).
Java SE Development Kit 11 Downloads: Download the Linux x64 Compressed Archive tar.gz file (for example: jdk-11.x.x-linux-x64_bin.tar.gz).
After downloading from the desired location, save this file in the staging folder and make sure the JAVA_VERSION and JAVA_ARCHIVE variables in build.env file are correct.
ThingWorx Platform archive files
Download the ThingWorx Platform archive files from the same ThingWorx Platform part of the PTC Software Downloads site that contains this Dockerfile release. Make sure to use same ThingWorx version as that for the set of Dockerfiles, as there could be differences. Example File: Thingworx-Platform-H2-<n-n-n>.zip
Save this file in the staging folder and make sure the PLATFORM_TYPE_VERSION and PLATFORM_TYPE_ARCHIVE variables in the build.env file are correct.
Template Processor archive file
The template-processor tool is included in the staging folder by default and should be included in the Docker builds automatically. Make sure the TEMPLATE_PROCESSOR_VERSION and TEMPLATE_PROCESSOR_ARCHIVE build.env file settings are correct.
Security Tool Archive
The security-tool program is included in the staging folder and should be included in the Docker builds automatically. Make sure the version and archive file names in staging match your build.env settings.
Tomcat archive file
Download Tomcat from Apache at the Tomcat 9 Software Downloads site. Choose to download the Core version and select tar.gz. Example File: tomcat-9.0.35.tar.gz
Save this file in the staging folder and make sure the TOMCAT_VERSION and TOMCAT_ARCHIVE variables in the build.env file are correct. Note that the default expected name is tomcat-version.tar.gz unless otherwise changed inside build.env.
Microsoft JDBC Driver for SQL Server
Download the Microsoft JDBC Driver from Microsoft at Java and JDBC specification support. Once you have determined the compatible JDBC Driver version from the Release Advisor, download that version from the displayed versions. From the options displayed for For the driver in a tar.gz file:, select the English (United States) version (as the file structure differs with alternate languages). The sqljdbc_<version>_enu.tar.gz file is downloaded.
Save this file in the staging folder and make sure the SQLDRIVER_VERSION and SQLDRIVER_ARCHIVE variables in the build.env file are correct.
Microsoft JDBC Driver for Azure SQL
Download the Microsoft JDBC Driver from Microsoft at Java and JDBC specification support. Once you have determined the compatible JDBC Driver version from the Release Advisor, download that version from the displayed versions. From the options displayed for For the driver in a tar.gz file:, select the English (United States) version (as the file structure differs with alternate languages). The sqljdbc_<version>_enu.tar.gz file is downloaded.
Save this file in the staging folder and make sure the AZURE_SQLDRIVER_VERSION and AZURE_SQLDRIVER_ARCHIVE variables in the build.env file are correct.
Was this helpful?