Skip to main content
Version: 5.4

Deployment Docker

What is Docker?

Docker is a software platform that enables executing applications and their dependencies in isolated containers. Docker offer a certain number of advantages for the development, deployment and scaling of softwares :

  • Portability: Docker containers can be executed on any machine on which Docker is installed, regardless of the operating system or hardware.
  • Consistency: Docker containers ensure that application always run under the same conditions, regardless of whether they are exectued locally, in the cloud or on another server.
  • Efficiency: Docker containers use the resources from the host machine in an optimal way, by supplying only what is necessary for the application. This reduces storage space and energy consumption.
  • Security: Docker containers isolate the applications from one another and the host system, which reduces the risk of attacks and conflicts.

With help of Docker, the OPC Router can work with any environment, in which a Docker installation is possible.

Installing Docker

To install Docker, follow the instructions of the official Docker documentation for your platform.

To confirm that the Docker installation is a success, you can execute the following command, to your command prompt: docker --version If you receive a message like Docker version 20.10.22 build 3a2c30b, Docker is ready to be use.

note

Note: When run in a container (for example: Docker, Kubernetes), licensing with online synchronization is required if is operating without a TPM2 module.

Docker Container with TPM2

Fast test installation of the OPC Router with Docker

The Docker OPC Router 5 container can be installed fast for testing by executing only one command in seconds :

docker run -d -e OR_DISABLE_AUTH=true -e OR_I_ACCEPT_EULA=true --name opcrouter5 -p 8080:8080 opcrouter/runtime:latest
note

By executing this command, you agree to the end user licence conditions by setting the environment variable OR_I_ACCEPT_EULA to true.

warning

This command doesn't create any persistent volumes. By deleting the container via Docker Desktop, all data of the container, for example the configured projects, will get irrevocably lost. The command is therefore not suitable for productive use.

By executing the command, a new container named opcrouter5 is being created. Port 8080 is being published on the host. The Web Management should be accessible locally at http://127.0.0.1:8080.

The command docker container rm -f opcrouter5 stops and deletes the container. The temporary volumes of the automatic created container, which contain the data and the configuration of the project, will not be automatically deleted by this command.

The Docker images of the OPC Router

The OPC Router have two different images available:

  • The Runtime image (opcrouter/runtime) contains the OPC Router application, the web management, and an integrated MongoDB in which data of the OPC Router such as projects, are stored.
  • Like the runtime image, the service image (opcrouter/service) contains the application and the web management, but no integrated MongoDB. A MongoDB must be connected separately for the application to run.

Instead of a test installation, a Docker Run command is described here that is suitable for a productive use. This command cannot just simply be copied and run. It must be adapted before running it.

docker run -d --pull always \
--name opcrouter5 \
-e OR_I_ACCEPT_EULA=false \
-e INITIAL_USERNAME=***** \
-e INITIAL_PASSWORD=***** \
-e TZ=Europe/Berlin \
-v opc-router-5-data:/data \
-v opc-router5-logs:/var/log/opcrouter \
-p 8080:8080 \
-p 8001:8001 \
-p 49420:49420 \
opcrouter/runtime:latest
warning

For this command to work, you must agree the end user license agreement by setting the environment variable OR_I_ACCEPT_EULA to true, and by specifying a valid username and password for the initial user in the environment variables INITIAL_USERNAME and INITIAL_PASSWORD.

Some used arguments are explained here:

  • -d: The container is being started as a background process.
  • --pull always: Ensures that the current version of the image is downloaded when the command is executed if it differs from an existing local version.
  • --name: Sets a unique name for the container.
  • -e: Sets an environment variable.
  • -v: Sets a persistent volume.
  • -p: Publishes an internal post on the host.

With the environment variables, it should be noted that we set an initial user with username (INITIAL_USERNAME) and password (INITIAL_PASSWORD) with which we can log into Web Management. The time zone is also being set. A more detailed explanation and list of all configurable environment variables can be found here:

Configurable environment variables

For the two available mount paths, persistent volumes are being created, so that the data on the container, like the project structure, backups of the project, log files, etc. are being kept when we delete the container and create a new one with the same volumes. A detailed explanation of the mount paths available can be found here:

Mount paths