Create Docker® image

The Makefile in this example is used to simplify and automate common Docker® tasks. In this way, the Docker® image can be created with the Makefile.

The subfolder tc31-xar-base contains all the necessary files and configurations to create a Docker® image for a TwinCAT 3.1 XAR environment. The purpose of this subfolder is to provide a self-contained build context for creating a Docker® image that can run TwinCAT applications.

Proceed as follows:

1. First add valid myBeckhoff access data in the Linux® system in the configuration file bhf.conf:
/tc31-xar-base/apt-config/bhf.conf
2. Install make on the host system.
sudo apt install make

Install the build automation tool make on your host.

sudo apt install make

You can then use the Makefile to create the image. To do this, first navigate to the example directory and execute the following command:

sudo make build-image

Alternatively, you can also navigate to tc31-xar-base of the repository and execute the following command:

sudo docker build --network host -t tc31-xar-base

Creating the Docker® image

During the image creation process, TwinCAT for Linux® is loaded as a package from https://deb.beckhoff.com.