Installing SIA Connect ANY-Ware using Docker commands
Learn how to run SIA Connect as a Docker container using command line
SIA Connect can be virtualized and run as a Docker container from the provided image.
In this articles you learn how to run the solution from Docker commands. The Docker images are available on Dockerhub where you will also find instructions and additional information. In addition you can also use the Docker compose to orchestrate the Docker commands and configuration in a simple way.
Visit SIA Connect on Dockerhub
Creating the Docker container from SIA Connect Docker image
In the following sections you will learn how to get started the single Docker image for SIA Connect. Getting started consists of a few steps:
- Create a volume for persistent data (licenses, Connectors, data, etc)
- Pull the image
- Starting the container with the proper configuration and parameters
TL;DR:
docker volume create siaconnect_data
docker pull siaconnect/siaconnect:latest
docker run --name siaconnect -e "SIA_CONNECT_PASSWORD=secret_password"-p 80:80 -p 443:443 -v siaconnect_data:/opt/SIA/plugins --restart=always siaconnect/siaconnect:latest
If you want to learn more about the commands and parameterization, continue to reading the article.
Initializing volume & container
First thing you will need to do is to create a volume to persist data such as license files, installed Connectors, configuration and data.
docker volume create siaconnect_data
in above command we create a volume named siaconnect_data
which will be used when starting the container.
Next steps is to pull the latest Docker image from the remote container registry.
docker pull siaconnect/siaconnect:latest
in above command we pull the latest image tagged with latest
. If you wish to pull a specific version use the below command:
docker pull siaconnect/siaconnect:x.y.z
where x.y.z
defines the version of the image. Click here to find all the available tags at Dockerhub.
Creating the container
When starting the container the first to need to ensure the proper parameters are parsed. If you afterwards need to add or update the parameters you can though recreate it again with the new parameters.
The below example takes example in the most basic parametrization of the container:
docker run --name siaconnect -e "SIA_CONNECT_PASSWORD=secret_password" -p 80:80 -p 443:443 -v siaconnect_data:/opt/SIA/plugins --restart=always siaconnect/siaconnect:latest
where you might need to take action on the below parameters:
SIA_CONNECT_ADMIN_PASSWORD=secret_password
defines the environment variable PASSWORD which will be used as system password. Replace secret_password with a safe password you can remember.
-p 80:80
defines the host and target port (host_port:target_port) that is being mapped to the containers port 80 where the GUI portal is running in a web app. The GUI is available in a browser at http://localhost
If port 80 is already in use at your host system select another port by replacing it with -p new_port:80
. The GUI are then accessible at http://localhost:new_port
Note down your run command
It is a good idea to note down the run command and the parameters so you can update and recreate at a later stage. Also you can check out how to recover the run command in a section below
Starting & stopping the container
To start and stop the container after creating use the below commands:
docker start siaconnect
docker stop siaconnect
Updating & recreating the container
There might be several reasons you want to recreate the container.
- Update available to the SIA Connect image
- New parameters needs added
- Open port for OPC-UA server
- Another port for the Web GUI portal needs used
- ….
Updating image
When the image gets updated you will be noticed in the GUI portal, but in order to update the image and afterwards recreate the container you will need to carry out some Docker commands.
To pull the latest image or a specific version use the following command:
#Latest image
docker pull siaconnect/siaconnect:latest
#Specific version
docker pull siaconnect/siaconnect:x.y.z
where x.y.z
defines the version of the image. Click here to find all the available tags at Dockerhub.
Recreating the container with the new image
Re-use volume
In order to keep the license, data, configuration etc. it is important you mount the same volume as you used previously.
To apply the new updated image or add new parameters the container needs recreated. This is done by deleting it and creating it again.
docker rm siaconnect
docker run --name siaconnect -e "SIA_CONNECT_PASSWORD=secret_password" -p 80:80 -p 443:443 -v siaconnect_data:/opt/SIA/plugins --restart=always siaconnect/siaconnect:latest
If you cannot remember the run command of the container you can check the section below on how to recover the run command.
That's it, the image is updated!
Recover previous run command
When updating the container you need to remember your old container start command. If you forgot this you can recover it by using a tool called runlike
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock:ro assaflavie/runlike siaconnect
which will return you a similar run copy which you used for the previous container. Example of output:
docker run --name=siaconnect --hostname=0ce95b6ec071 --mac-address=02:42:ac:11:00:05 --env=PASSWORD=secret_password --volume=siaconnect_data:/opt/SIA/plugins -p 443:443 -p 80:80 --restart=always --runtime=runc siaconnect/siaconnect:latest /bin/sh -c 'exec /bin/bash -c "/docker-entrypoint.sh ; tail -f /dev/null"'
some of the parameters returned by the command can be removed and cooked down to the original run command would yield:
docker run --name=siaconnect --env=SIA_CONNECT_PASSWORD=secret_password --volume=siaconnect_data:/opt/SIA/plugins -p 443:443 -p 80:80 --restart=always siaconnect/siaconnect:latest