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.
Required Files
The following files are required to build ThingWorx Docker.
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.0.21.tar.gz
java
The Java JDK (version 8) archive file obtained from Oracle.
jdk-8u172-linux-x64.tar.gz
Required archive files for the individual platform versions:
Platform
Example File
ThingWorx Platform H2
Thingworx-Platform-H2-8.4.1-b2126.zip
ThingWorx Platform PostgreSQL
Thingworx-Platform-Postgres-8.4.1-b2126.zip
ThingWorx Platform Microsoft SQL Server
Thingworx-Platform-Mssql-8.4.1-b2126.zip
This version also requires the Microsoft JDBC Driver for SQL Server from Microsoft.
sqljdbc_6.0.8112.200_enu.tar.gz
ThingWorx Platform Azure SQL
Thingworx-Platform-Azuresql-8.4.1-b2126.zip
This version also requires the Microsoft JDBC Driver for SQL Server from Microsoft.
sqljdbc_6.0.8112.200_enu.tar.gz
* 
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.
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
PLATFORM_VERSION
8.4.1–b2126
Specifies the platform version.
JAVA_VERSION
8u172
Specifies the version of the Oracle Java JDK.
TOMCAT_VERSION
9.0.21
Specifies the version of Apache Tomcat.
TEMPLATE_PROCESSOR_VERSION
12.0.0.12
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
8.4.1-b2126
Specifies the version of the ThingWorx H2 Platform to build. Only required when building H2 containers.
PLATFORM_H2_ARCHIVE
Thingworx-Platform-H2-8.4.1-b2126.zip
Specifies the file name of the ThingWorx H2 .zip file in the staging folder. Only required when building H2 containers.
PLATFORM_POSTGRES_VERSION
8.4.1-b2126
Specifies the version of the ThingWorx PostgreSQL Platform to build. Only required when building PostgreSQL containers.
PLATFORM_POSTGRES_ARCHIVE
Thingworx-Platform-Postgres-8.4.1-b2126.zip
Specifies the file name of the ThingWorx PostgreSQL .zip file in the staging folder. Only required when building PostgreSQL containers.
PLATFORM_MSSQL_VERSION
8.4.1-b2126
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-8.4.1-b2126.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
6.0.8112.200
Specifies the version to install of the Microsoft JDBC Driver for SQL Server. Only required when building Microsoft SQL Server containers.
MSSQL_DB_TWX_DATABASE_PASSWORD
No default – must be set manually
Specifies the password for the Microsoft SQL Server database user. If BUILD_TEST_DBS is enabled and Microsoft SQL Server images are being built, this must be set for use by the image build process.
Ensure the password is at least 8 characters long and contains characters from three of the following four sets: uppercase letters, lowercase letters, base 10 digits, and symbols.
MSSQL_DB_TWX_DATABASE_USERNAME
No default – must be set manually
Specifies the user name for the Microsoft SQL Server database user. If BUILD_TEST_DBS is enabled and Microsoft SQL Server images are being built, this must be set for use by the image build process.
MSSQL_DB_TWX_DATABASE_SCHEMA
No default – must be set manually
Specifies this is the database schema for the Microsoft SQL Server database. If BUILD_TEST_DBS is enabled and Microsoft SQL Server images are being built, this must be set for use by the image build process.
MSSQL_DB_SA_PASSWORD
No default – must be set manually
Specifies the password for the Microsoft SQL Server sa user. If BUILD_TEST_DBS is enabled and Microsoft SQL Server images are being built, this must be set for use by the image build process.
Ensure the password is at least 8 characters long and contains characters from three of the following four sets: uppercase letters, lowercase letters, base 10 digits, and symbols.
PLATFORM_AZURESQL_VERSION
8.4.1-b2126
Specifies the version of the ThingWorx Azure SQL Platform to build. Only required when building Azure SQL containers.
PLATFORM_AZURESQL_ARCHIVE
Thingworx-Platform-Azuresql-8.4.1-b2126.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
6.0.8112.200
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-9.0.21.tar.gz
Specifies the name of the Tomcat archive file in the staging folder.
JAVA_ARCHIVE
jdk-8u172-linux-x64.tar.gz
Specifies the name of the Java archive file in the staging folder.
SQLDRIVER_ARCHIVE
sqljdbc_6.0.8112.200_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.
TEMPLATE_PROCESSOR_ARCHIVE
template-processor-12.0.0.10-application.tar.gz
Specifies the name of the template-processor 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 Java manually from Oracle due to the requirement to accept Oracle's licensing terms. It is available on the Java SE Development Kit 8 Downloads page. After accepting the license agreement on the page, download the Linux x64 tar.gz file (for example: jdk-8u172-linux-x64.tar.gz).
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-8.4.1-b2126.zip
Save this file in the staging folder and make sure the PLATFORM_TYPE_VERSION and PLATFORM_TYPE_ARCHIVE variables in 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.
Tomcat archive file
If you could not automatically download Tomcat, download it directly from Apache at the Tomcat 9 Software Downloads site. Choose to download the Core version and select tar.gz. Example File: apache-tomcat-9.0.21.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
If you could not automatically download the Microsoft JDBC Driver, or you want to use an alternate version, download it directly from Microsoft at Microsoft JDBC Driver 6.0 for SQL Server. Select the English version (as the file structure differs with alternate languages). On the following page, select sqljdbc_version_enu.tar.gz and click Next.
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
If you could not automatically download the Microsoft JDBC Driver, or you want to use an alternate version, download it directly from Microsoft at Microsoft JDBC Driver 6.0 for SQL Server. Select the English version (as the file structure differs with alternate languages). On the following page, select sqljdbc_version_enu.tar.gz and click Next.
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?