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
makeon the host system.
sudo apt install makeInstall the build automation tool make on your host.
sudo apt install makeYou 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-imageAlternatively, you can also navigate to tc31-xar-base of the repository and execute the following command:
sudo docker build --network host -t tc31-xar-baseCreating the Docker® image
During the image creation process, TwinCAT for Linux® is loaded as a package from https://deb.beckhoff.com.