Docker® container: Example configuration

The TwinCAT Runtime for Linux® can be containerized using Docker® or similar containerization tools. This makes it possible to run TwinCAT applications in predefined environments. In addition, this allows multiple TwinCAT Runtime instances to run on a single Beckhoff RT Linux® industrial PC.

TC_XAR_Container_Sample

The TC_XAR_Container_Sample on github.com provides step-by-step instructions for creating and deploying a containerized TwinCAT 3.1 XAR runtime environment using Docker® on a Beckhoff RT Linux®-based industrial PC.

Use of the Sample

You can download the sample as a ZIP file from the GitHub repository and transfer it to the industrial PC using WinSCP, as described at Managing files with the WinSCP client.

Alternatively, you can establish a connection to your Beckhoff RT Linux® industrial PC via SSH, as described at Remote access with SSH, and use git to clone the repository directly to the industrial PC:

Install Git on the industrial PC if it is not already installed:

sudo apt-get update
sudo apt-get install git

Clone the repository:

git clone https://github.com/Beckhoff/TC_XAR_Container_Sample.git
cd TC_XAR_Container_Sample

Requirements for the example

Make sure that the following requirements are met before you start the example:

Steps for implementation

If the requirements are met, simply carry out the following steps:

  1. Copy the sample files to the Linux® system.
  2. Check Docker® installation
  3. Create the container image with sudo make build-image
  4. Create firewall rules to allow connections via ADS over MQTT
  5. Create and start the container setup with sudo make run-containers
  6. Customize your TwinCAT ADS routes on your TwinCAT Engineering Station to establish a connection between TwinCAT XAR and the container.
  7. Configure the network interfaces for real-time Ethernet communication (optional)