Docker® container: Example configuration

The TwinCAT Runtime for Linux® can be containerized using Docker® or similar containerization tools. This allows the execution of TwinCAT applications in predefined environments. It also enables running multiple TwinCAT Runtime instances on a single Beckhoff RT Linux® industrial PC.

TC_XAR_Container_Sample

The TC_XAR_Container_Sample on github.com provides a step‑by‑step guide to build and deploy a containerized TwinCAT 3.1 XAR runtime environment using Docker® on a Beckhoff RT Linux®-based industrial PC.

Using 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 in Managing files with the WinSCP client.

Alternatively, you can connect to your Beckhoff RT Linux® industrial PC via SSH as described in Remote access with SSH and use git to clone the repository directly onto the industrial PC.

Install git on the industrial PC if 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

Prerequisites 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. Install Docker® Engine
  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