-
Notifications
You must be signed in to change notification settings - Fork 296
Scada LTS on Docker tutorial
-
Note!
Now it will be more complicated to run Scada-LTS application outside docker-compose enviroment. The most challenging part is to run the database server. So we recommend to use docker-compose approach. -
IMPORTANT
If you decide to use docker in production, you need to configure volumes to permanently store data: https://docs.docker.com/storage/volumes/
Create the simplest docker container with Scada-LTS application. While this container is running user is able to operate through the application instance. Container keeps the state of the application until it has not been removed. It is possible to keep more than one container of specific image.
- Use your CLI to download the latest Scada-LTS image
docker pull scadalts/scadalts:latest
- Verify that image with tag 'release' from 'scadalts/scadalts' repository has been downloaded. (optional)
- Create and run a simple docker container from release image
(parameter -p expose and perform port mapping from internal port 8080 to external 81 that is visible on host machine)
docker run -p 81:8080 scadalts/scadalts:latest
- Attach shell and change the database reference inside
context.xml
file. - Restart container and open the browser. Wait for the Scada-LTS application to start.
http://localhost:81/ScadaBR/
When you started a containers using docker-compose up
command you can find the name of the container by running following command. That will describe you the name of the container and its details.
docker ps
Using the name of the container user is able to start/stop the specific instances of Scada-LTS application. Each Scada-LTS docker container has its own database store so that there are no overlapping withing instances. We are able to identify the Docker container via UUID long identifier, UUID short identifier and a name. The easiest way is to use custom names that we manage by ourselves. To do that just use specific command:
docker run -p 81:8080 --name <container_name> scadalts/scadalts:<tag>
In this way we are able to create another instance of the Scada-LTS application.
We also can run this container in detached mode. Using that the container with specific will be running in the background.
docker run -d -p 81:8080 --name <container_name> scadalts/scadalts:<tag>
If user want to expose all the running applications he should run the container with network host mode. In this situation container’s network stack is not isolated from the Docker host.
docker run -d --network host --name <container_name> scadalts/scadalts:<tag>
Running container can be stopped, restarted or event deleted if it is no longer maintained. Docker operation run
has different behavior than start
. The first one creates and start the container from image, but the second one only starts the specific container. User has to be careful while creating the container because during the creation he define the configuration for that specific container.
docker start <container_name>
docker stop <container_name>
Connecting to a running Docker container with Scada-LTS allow user to restart the Tomcat Server or to start it in debug mode. This attach the interactive bash shell where user is able to do everything.
docker exec -it <container_name> bash
All Scada-LTS versions are available from official Scada-LTS Docker Hub profile. Next to the specific TAG there is a field with specific command with that tag to copy/paste.
This image is labeled with latest TAG. It contains the latest changes that has been made on the develop branch on the GitHub repository.
Example:
docker pull scadalts/scadalts:latest
To check the specific feature build version just find the TAG that respond to the GitHub pullrequest number.
Example:
docker pull scadalts/scadalts:pr-1502