- Print
- DarkLight
- PDF
SiteManager Embedded in Docker
Introduction
Introduction
This tutorial will provide you with the skills needed to run SiteManager Embedded in Docker.
SiteManager Embedded is the software version of SiteManager; the plug-in IoT Gateway for secure remote access, device analytics, permissions management and Machine Data collection. Using SiteManager in Docker enables convenient SiteManager Embedded implementation across multiple devices on your intranet.
At the end of this article, you will have created your own containerized installations of SiteManager Embedded.
- You'll need some knowledge on to how to install and use Docker. You can find information here:
https://docs.docker.com/get-docker/ .
- You should have a basic understanding of how to use the Secomea solution: Start here .
- A PC suitable for use as a build server (It must have a compatible OS), running Docker version 20 (or higher).
- You will need a docker repository for cross-building on multiple devices.
How to run a container on a Local target host
In this example, we will use a Raspberry pi with HypriotOS as the target host device.
- Docker must be installed on the target host.
- Downloaded Secomea Dockerfiles (firmware is automatically downloaded from Secomea)
Instructions:
- Download the Secomea docker file (from the links at the bottom of this article) to the target host.
2. Place the docker file into a suitable folder on the target host.
3. Build the Dockerfile in a suitable location (See the example directory below).
Use this Syntax:
Command options dockerfile imagename:tagname
//Build command example
docker build -f v6322_arm.Dockerfile -t sme_v6322_armv7_dcm .
4. Set up the configuration file so it can connect to Gate Manager.
First, we need to create the folder "/opt/secomea/sme" and the configuration file sme.txt
//use this command to create and go into the folder
sudo mkdir -p /opt/secomea/sme && cd /opt/secomea/sme
Then set up the configuration file so that it can establish a GM connection. Create a file called sme.txt
in the prepared configuration directory and type in the GM FQDN or IP address, and the domain the SM-E should attach to:
Server=gmXX.secomea.com
Domain=domainname
Your containerized SiteManager Embedded installation is now ready for use.
// Run command example:
docker run -d --network host -v /opt/secomea/sme:/etc/sitemanager -w /etc/sitemanager --privileged sme_v6322_armv7_dcm
Cross-build SiteManager Embedded in Docker
This implementation is used to scale SiteManager Embedded over multiple devices. This is useful for running SM-E docker on multiple machines with substantially different specifications.
Our example uses a PC with FedoraOS as the build server and a Raspberry pi with HypriotOS as the target host. This method can be used with any compatible system.
- A build server (PC) with DockerEngine version 20+.
- Docker must be installed on the target host.
- Secomea Dockerfiles (all firmware is automatically downloaded from Secomea).
- A Docker hub repository (Free for non-commercial use).
You must enable the multi-architectural build environment in Docker:
docker run --privileged --rm docker/binfmt:a7996909642ee92942dcd6cff44b9b95f08dad64
DOCKER_BUILDKIT=1
Instructions:
On the build PC
1. Download the docker distribution compatible with your target host. You can download Secomea Dockerfiles from the bottom of this article.
2. Prepare Docker by accessing the docker file in a folder on your build server.
The syntax is: <Command> <options> <docker file> <repository:tagname>
//Build with any file name:
docker build --platform linux/arm/v7 -f v6122_arm.Dockerfile -t v6122_sme .
//Change name to match repository and tag
docker tag v6122_sme:latest 2voss/my_secomea_containers:95_v6122_sme
3. Prepare your docker Container by building the Docker file in a suitable location on the Build Server PC.
docker build --platform linux/arm/v7 -f v6122_arm.Dockerfile -t 2voss/my_secomea_containers:95_v6122_sme .
4. Upload to your Docker repository from the Build Server PC.
//Login to your docker repository
docker login
*Username
*Password
//Push to your repository
docker push 2voss/my_secomea_containers:95_v6122_sme
Install containers on Target Host devices.
5. Download your newly built container from the Repository to the Target Host(s).
//Login to your docker repository
docker login
*Username
*Password
//Pull command example
docker pull 2voss/my_secomea_containers:95_v6122_sme
6. Verify the existence of your container.
7. Set up a configuration file so it can connect to Gate Manager Embedded.
First we need to create the folder "/opt/secomea/sme" and the config file sme.txt
//use this command to create and go into the folder
sudo mkdir -p /opt/secomea/sme && cd /opt/secomea/sme
8. Type in Gate Manager’s FQDN. Alternatively, type in the IP address and domain name Site Manager Embedded should attach to.
Server=gmXX.secomea.com
Domain=domainname
Or
Server=xxx.xxx.xxx.xxx
Domain=domainname
Congratulations! You are now ready to launch SiteManager Embedded from a Docker Container.
Shell
// Run command example
docker run -d --network host -v /opt/secomea/sme:/etc/sitemanager -w /etc/sitemanager --privileged 2voss/my_secomea_containers:95_v6122_sme
Additional information
// Container list
docker container ls
//Stop container
docker container stop [ID]
//Start container
docker container start [ID]
Downloads
Type | Dockerfile links | Version |
Linux X86 - 64 bit (typically Debian based OS or similar) | v6111_x64.Dockerfile | Ver 1.0 |
Linux ARMv7 - 32 bit | v6122_arm.Dockerfile | |
Linux ARMv8 - 64 bit | v6142_AARCH64.Dockerfile |