Docker single image
Learn how to run SIA Connect as a single container with a all-in-one Docker image
The Docker solution for SIA Connect comes as a single Docker image which includes everything in a single container. In addition it also comes as 3 different container that can be orchestrated in a composer project which you can read more about here.
In this articles you learn how to run the solution as a single container. The Docker images are available on Dockerhub where you will also find instructions and additional information.
Visit SIA Connect on Dockerhub
Sign-up for a free license
All installations comes with a free trial of 5 hours which can be restarted after a 30 minutes cooldown. You can extend your evaluation and get a free 30 days license by signing up at our website
Using the single 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 "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 "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:
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 "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=PASSWORD=secret_password --volume=siaconnect_data:/opt/SIA/plugins -p 443:443 -p 80:80 --restart=always siaconnect/siaconnect:latest