This project contains a container definition which configures all of the thin-edge.io components (including mosquitto) in a single container using the lightweight, container friendly init system, s6-overlay.
s6-overlay is an init system which is designed to run multiple processes in a single container. It starts and supervises each service, in addition to supporting startup/initialization scripts. For more details about s6-overlay, check out the s6-overlay documentation.
This repository might be helpful if you are looking for a simple container deployment of thin-edge.io and don't want to spawn multiple containers, and your device does not have access to a Kubernetes instance like (k3s).
Features
The tedge-container-bundle provides the following features:
c8y.url
) via environment variablesThe following are required in order to deploy the container
Option 2: Container network (Recommended)
All of the thin-edge.io settings can be customized via environment variables which can be added via the -e KEY=VALUE
to the docker run
command:
TEDGE_C8Y_OPERATIONS_AUTO_LOG_UPLOAD=always
The following tools are required to run the container:
After the project pre-requisites have been installed, you can start the container using the following steps:
Create a .env
file containing the environment variables (see the Providing the device certificate by environment variables for details on how to provide the device certificate)
# device id to use for the certificate
DEVICE_ID=demo01
# Which c8y instance you want to connect to
TEDGE_C8Y_URL=example.cumulocity.com
# You can turn specific services on/off via environment variables
SERVICE_TEDGE_MAPPER_AWS=0
SERVICE_TEDGE_MAPPER_AZ=0
SERVICE_TEDGE_MAPPER_C8Y=1
# Other settings
TEDGE_C8Y_OPERATIONS_AUTO_LOG_UPLOAD=always
Activate your Cumulocity session using go-c8y-cli
set-session
Note
Your go-c8y-cli session profile needs to have the following setting set (and you will have to run set-session
again afterwards):
c8y settings update session.alwaysIncludePassword true
# Then re-activate the session
set-session
Init the device certificate (stored in a container volume) and upload it to Cumulocity IoT
just init
Start the container (using docker compose)
# using the justfile task
just start
# Or using docker compose directly
docker compose up --build
Directory | Description |
---|---|
cont-init.d/ | Initialization scripts which are run before the services are started |
files/tedge/plugins/ | Default thin-edge.io plugin configuration files to control defaults such as log and configuration management settings |
files/tedge/tedge.toml | File based thin-edge.io default settings. An alternative, if you don't want to set thin-edge.io setting via environment settings |
files/mosquitto/mosquitto.conf | Default mosquitto settings to control logging and data persistence |
USER