Without a manager, a container image is merely an artifact that the user must deploy and run manually using a container runtime. That leaves the user responsible for tasks such as:

  • Starting and stopping the different containers

  • Monitoring containers health

  • Relaunching containers on unexpected stop/crash

  • Collecting logs

  • Handling different types of containers (LXC, Podman/Docker)

The ConnectCore Container Manager centralizes all these tasks in a single service.

The Container Manager supports:

  • LXC containers, managed with runtime lxc

  • OCI-type containers (Podman/Docker) managed with runtime podman

  • Digi Container Package (DCP), which is a tarball containing an LXC or OCI-type container with a manifest

Evaluate the Container Manager

Refer to Get started with containers to install a pre-built image on your device where you can exercise the ConnectCore Container Manager.

Add the Container Manager to your custom image

To add the ConnectCore Container Manager to your custom image add this to your project’s conf/local.conf:

conf/local.conf
IMAGE_INSTALL:append = " cc-container-mng"

Components

File Description

/usr/bin/cc-containerd

Container Manager daemon

/etc/cc-container-mng.conf

Container Manager configuration file

/usr/bin/containerctl

Command-line interface application to interact with the daemon

/root/cc-container/cc-containers.conf

Contains the configuration for all containers being managed by the Container Manager

/root/cc-container/state.json

Contains the status and statistics for all containers being managed by the Container Manager

Daemon configuration file

The daemon configuration file is /etc/cc-container-mng.conf.

Example configuration file
{
  "version": 1,
  "service": {
    "working_path": "/root/cc-container",
    "monitor_interval": 10,
    "command_timeout": 30,
    "podman_load_timeout": 600
  },
  "logging": {
    "level": "ERROR",
    "syslog": {
      "enabled": true,
      "level": "INFO"
    },
    "console": {
      "enabled": true
    },
    "file": {
      "enabled": true,
      "path": "/var/log/cc-containerd.log",
      "level": "INFO",
      "max_size": 10485760
    }
  }
}
Section Field Description

service

working_path

Working path for containers managed by the Container Manager.

monitor_interval

Period (in seconds) to query the status and statistics of containers.

command_timeout

Timeout (in seconds) to consider that a command failed.

podman_load_timeout

Timeout (in seconds) to consider a load command failed, for OCI-type (Podman/Docker) containers.

logging

level

Default log level for syslog, console, file. Can be overridden by more specific level fields.

enabled

For every logging method (syslog, console, file), defines whether log is enabled.

path

For the file log method, path to the log file.

max_size

For the file log method, max size (in bytes) of the log file.

Containers configuration file

The containers configuration file is /root/cc-container/cc-containers.conf. This file has one entry for every container managed by the Container Manager.

Example entry (with one container):
{
  "containers": [
    {
      "id": "lvgl-demo",
      "friendly_name": "LVGL Demo",
      "version": 1,
      "runtime": "podman",
      "create_args": "--privileged --network host --tty",
      "autostart": false,
      "monitor": true,
      "restart": {
        "enabled": true,
        "max_retries": 3,
        "retry_delay": 3,
        "window": 60
      }
    }
  ]
}
Field Description

id

Unique identifier for the container

friendly_name

Descriptive name of the container

version

Version number of the container

runtime

Runtime to use for this container:

  • lxc, for LXC containers

  • podman for OCI-type (Podman/Docker) containers

create_args

Arguments for podman runtime (Podman/Docker) containers

autostart

Defines whether or not the container will start automatically after boot (or container installation)

monitor

Defines whether the daemon must periodically query the container for status

restart

Set of restart parameters

- enabled

Defines whether the daemon must restart the container in case it stops

- max_retries

Number of times the daemon should try to restart the container before giving up

- retry_delay

Seconds to wait between restart retries

- window

Time window (in seconds) to consider the daemon is doing a restart retry of this container