Weidmueller UC20 SL2000-OLAC EC Docker on U Control Studio User Guide
- June 4, 2024
- Weidmueller
Table of Contents
2638920000 and others
Quick Start Guide for docker on u-control studio
Instructions for the installation of docker environment and portainer
UC20 SL2000-OLAC EC Docker on U Control Studio
User Guide
UC20-SL2000-OLAC-EC Docker on U-Control Studio
Revision history
Version | Date | Change log | Author |
---|---|---|---|
1 | 2020-03 | First released version | w010521 |
2 | 2021-03 | complete revision – added information for V4.x / Debian 10 |
w011498
3| 2021-03| review| w010174
4| 2021-06| Separate chapters for different Debian versions information for
time synchronization updated| w011498
Contact
32758 Detmold, Germany
T+49 5231 14-0
F+49 5231 14-292083
info@weidmueller.com
www.weidmueller.com
For further support please contact your local sales representative.
Template: V2.1 – 2020-01
Warning and disclaimer
Warning
Controls may fail in unsafe operating conditions, causing uncontrolled
operation of the controlled devices. Such hazardous events can result in death
and/or serious injury and/or property damage. Therefore, there must be
provided safety equipment/ electrical safety design or other redundant safety
features that are independent of the automation system.
Disclaimer
This Example / Application Note does not relieve you of the obligation to
handle it safely during use, installation, operation, and maintenance. Each
user is responsible for the correct operation of his control system. By using
this program example/application note prepared by Weidmüller, you accept that
Weidmüller cannot be held liable for any damage to property and/or personal
injury that may occur because of the use.
Note
The application examples do not represent customer-specific solutions, they
are simply intended to help with typical tasks. The user is responsible for
the proper operation of the described products. This application example does
not relieve you of the obligation of safe use, installation, operation, and
maintenance. Application examples are not binding and do not claim to be
complete in terms of configuration as well as any contingencies. By using this
Application Example, you acknowledge that we cannot be held liable for any
damages beyond the described liability regime. We reserve the right to make
changes to this sample application at any time without notice. In case of
discrepancies between the proposals in the application example and other
Weidmüller publications, like manuals, such contents always have more priority
than the examples. We assume no liability for the information contained in
this document. Our liability, for whatever legal reason, for damages caused by
the use of the examples, instructions, programs, project planning and
performance data, etc. described in this application example is excluded.
Security notes
In order to protect equipment, systems, machines, and networks against cyber
threats, it is necessary to implement (and maintain) a complete state-of-the-
art industrial security concept. The customer is responsible for preventing
unauthorized access to his equipment, systems, machines, and networks.
Systems, machines, and components should only be connected to the corporate
network or the Internet if necessary and appropriate safeguards (such as
firewalls and network segmentation) have been taken.
Abstract
This guide contains instructions on how to install Docker on u-control studio.
Requirements
- Engineering software u-create studio >= V1.20.2
- Weidmueller UC20-SL2000-OLAC (or similar) with “open Linux”
- The PLC must have internet access (configuration in chapter 4.1)
Workflow
4.1. Controller (basic configuration / DevAdmin)
-
If not done yet, follow the general U-Create Studio Quick Start Guide in order to use the u-create studio for creating a new SD card target. This target must contain your public key for ssh access: See chapter “4 Adding a personal SSH key for u-create studio installation” in the U-Create Studio Quick Start Guide.
Note: In case of u-create studio V4.2, check chapter 4.2.2 before creating the target. -
Update the PLC with the new target.
-
Open the PLC’s u-control web server (DevAdmin) via the IP address you assigned during target creation and login.
The default settings are:
IP | 192.168.101.100 |
---|---|
Username | Administrator |
Password | to be changed |
- Change to tab “Config” and change values to your needs…
- add the correct gateway address
- add at least one DNS Server (Default: Google DNS servers)
- set the correct date and time
- set the correct time zone
- Don’t forget to apply new settings!
Note: It is recommended to attach a buffer battery for the RTC.
4.2. Controller (advanced configuration / ssh)
- Login to your PLC via ssh (we suggest PuTTY).
- Check whether you have a functional internet connection to your PLC:
I. Enter “sudo ping www.google.de” in the shell
II. Compare the PLC’s output with the picture below.
4.2.1. U-create studio V1.20.2 (Debian 8)
-
1. add the Debian repository to the system
echo “deb http://deb.debian.org Debian Jessie main contrib non-free” | Sudo tee \/etc/apt/sources.list.d/Debian.list
This will create a new file called Debian. list with an entry for the corresponding Debian repository in /etc/apt/sources.list.d/ -
update the package list Sudo apt-get update
Sudo apt-get update
3. Install additional packages Sudo apt-get install –no-upgrade \ apt- transport- HTTPS: ca-certificates \ curl \ gnupg2 \ rdate -y
time synchronization via ‘NTP’
It is strongly recommended NOT to use any NTP client/server daemon due to
negative influences on real-time behavior.
sudo timedatectl set-ntp 0
If you are not able to use a buffer battery for the RTC (real-time clock), you
can use a workaround in order to adjust the date & time after every reboot of
the controller.
You need to specify a time server by hostname or IP.
example 1:
sudo echo “@reboot root /usr/bin/rdate -ns 192.168.0.1” >> /etc/crontab
example 2:
sudo echo “@reboot root /usr/bin/date -ns time.google.com” >> /etc/crontab
add the docker repository
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add –
echo “deb [arch=armhf] https://download.docker.com/linux/debian Jessie
stable” | Sudo tee \/etc/apt/sources.list.d/docker.list
4.2.2. U-create studio V4.2 (Debian 10)
-
add the Debian repository to the system
echo “deb http://deb.debian.org/debian/ buster main contrib non-free” | Sudo tee \/etc/apt/sources.list.d/Debian.list
This will create a new file called Debian. list with an entry for the corresponding Debian repository in /etc/apt/sources.list.d/ -
update the package list Sudo apt-get update
-
Install additional packagessudo apt-get install –no-upgrade \ apt-transport- https\ ca-certificates \ curl \ gnupg2 -y
-
add the docker repository curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add –
echo “deb [arch=armhf] https://download.docker.com/linux/debian buster stable” | Sudo tee \/etc/apt/sources.list.d/docker.list -
time synchronization via ‘NTP’
In u-create Studio 4. x, you can configure the NTP server in the engineering software. This has to be done before the SD card target is created.
4.3. Docker installation (community edition)
-
Install Docker-CE:
sudo apt-get update
sudo apt-get install docker-ce -y -
To avoid the additional “sudo” in front of every docker command, we add our user admin to the new group docker:’
sudo usermod -aG docker admin -
Reboot the PLC:
sudo reboot -
Check the proper installation of Docker:
sudo systemctl status docker.service
this should show something similar to the picture below: Note:
Since the u-control studio has no entry for the DNS server in /etc/.resolv.conf, the docker environment cannot detect any user-defined DNS server.
Therefore the default DNS settings for docker will be used… 8.8.8.8 / 8.4.4.8 (Google). -
Finally run the first container
sudo docker run hello-world
You should get a terminal output like this… -
Now you can use your docker environment.
For additional information have a look at https://www.docker.com/
4.4. Portainer installation (community edition)
“Portainer is comprised of two elements, the Portainer Server, and the
Portainer Agent. Both elements run as lightweight Docker containers on a
Docker engine or within a Swarm cluster. Due to the nature of Docker, there
are many possible deployment scenarios: We have detailed the most common
below. Please use the scenario that matches your configuration best.
Note that the recommended deployment mode when using Swarm is using the
Portainer Agent.” © portainer.io
-
Login to your PLC via ssh (we suggest using PuTTY).
Use the following Docker commands to deploy the Portainer Server; note the agent is not needed on standalone hosts, however, it does provide additional functionality if used (see portainer and agent scenario below):
$ docker volume create portainer_data
$ docker run -d -p 8000:8000 -p 9000:9000 –name=portainer –restart=always -v/var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer /portainer-ce -
Access the portainer.io web interface
You access the portainer.io web interface via port 9000 of the Docker engine where portainer is running. To do so, open the IP address of your PLC in your browser and add “:9000”. Example:
The IP address of your PLC is 192.168.0.100. Then you use 192.168.0.100:9000 as the URL in your browser to load the portainer.io web interface of your PLC.
Note: Port 9000 is the general port used by Portainer for UI access. Port 8000 is used exclusively by the EDGE agent for the reverse tunnel function. If you do not plan to use the edge agent, you do not need to expose port 8000 .
Note: the option “-v /var/run/docker.sock:/var/run/docker.sock” can be used in Linux environments only. -
Create an administrative user. On the first access after installation, the portainer.io web interface prompts you with the “create initial administrator user” dialogue:
-
Choose Docker as the environment you would like to manage:
-
This will direct you to the home screen of portainer.io …
-
Click on the “local” environment to go to the LOCAL Dashboard. This is the main window to manage your Docker environment.
ATTENTION:
Please always remember that the UC20-SL2000-OLAC’s resources are limited.
It cannot be ruled out that the use of these features can have a negative
effect on the real-time behavior of the PLC processing.
****QSG0022v04-UC20
References
- Index of /debian
- Docker and Kubernetes Management | Portainer
- Weidmüller: Smart Industrial Connectivity from Detmold with Love
Read User Manual Online (PDF format)
Read User Manual Online (PDF format) >>