A Digi Container Package (DCP) is a tarball that includes an LXC or OCI (Docker/Podman) container image plus a manifest with information for the ConnectCore Container Manager daemon to manage it during its life cycle (version, runtime arguments, restart options…)
Why use a DCP?
When you install a raw container artifact on the target, you need to specify different parameters, such as the runtime the daemon must use, the restart policy, and such. A DCP solves it at build time by packaging:
-
the container payload
-
runtime metadata
-
registration defaults
-
optional auxiliary files such as README or changelog for your records
This lets you distribute containers to a fleet of devices and be sure they will install and run consistently on all of them.
DCP structure
A DCP consists of:
| File/Directory | Description |
|---|---|
|
Contains registration information and run parameters for the Container Manager daemon |
|
Contains the LXC or Podman/Docker container tarball |
|
At build-time, this is filled with validation checksums |
|
Optional folder for custom metadata |
Manifest file
The manifest.json describes the package and the default behavior that the Container Manager should apply on installation.
manifest.json{
"package_id": "redis-demo",
"friendly_name": "Redis Demo",
"version": "1.0",
"runtime": "podman",
"create_args": "--privileged --network host --tty",
"registration_defaults": {
"autostart": true,
"monitor": true,
"restart": {
"enabled": true,
"max_retries": 3,
"window": 60,
"retry_delay": 3
}
},
"device_types": ["ccimx95-dvk"],
"firmware_versions": "",
"build_id": "",
"description": "Redis demo image from docker.io",
"labels": {}
}
| Field | Description |
|---|---|
|
Unique identifier for the container |
|
Descriptive name of the container |
|
Version number of the container |
|
Runtime to use for this container:
|
|
Arguments for podman runtime (Podman/Docker) containers |
|
Set of fields to manage the container |
|
Defines whether or not the container will start automatically after boot (or container installation) |
|
Defines whether the daemon must periodically query the container for status |
|
Set of restart parameters |
|
Defines whether the daemon must restart the container in case it stops |
|
Number of times the daemon should try to restart the container before giving up |
|
Seconds to wait between restart retries |
|
Time window (in seconds) to consider the daemon is doing a restart retry of this container |
|
(unused) Set of platforms for which the container is compatible |
|
(unused) Range of firmware versions for which the container is compatible |
|
(unused) A build identifier (e.g. a git commit SHA1, an internal build number) to correlate installed artifacts with build outputs |
|
(unused) Description of the container |
|
(unused) A set of free-form strings used for classification and filtering |
Payload
The payload must be a tarball with an LXC or OCI-type (Podman/Docker) container.
To obtain a tarball from an existing OCI-type image on your host computer, use the command podman save (or docker save).
Generate a DCP
Generate a DCP from an existing container on your host
To generate a DCP from an existing container you need an LXC bundle (.tar.gz) or an OCI-type (Podman/Docker) image archive (.tar).
See Payload.
-
Create a
manifest.jsonfile (see Manifest file for reference). -
Run
generate-dcp.pyscript from meta-digi-containers layer with the payload and the manifest file as arguments:$ python3 /usr/local/dey-5.0/sources/meta-digi/meta-digi-containers/scripts/generate-dcp.py \ --manifest <your-path>/manifest.json \ --payload <your-path>/<your-payload-file>This generates an artifact with a filename such as
<your-container>-ccimx95-dvk.tar.gz.
Build a DCP from a demo template
The meta-digi-containers layer contains a number of demo templates in folder meta-digi-containers/containers/:
| Demo name | Description |
|---|---|
chromium-demo |
A demo that features full-featured Chromium web browser engine with an HTML demo. |
flutter-demo |
A graphical demo using Flutter. |
lvgl-demo |
A graphical demo using LVGL. |
webkit-demo |
A graphical demo that features WebKit browser engine with an HTML demo. (Not supported for the ConnectCore 95) |
The layer provides a recipe dey-image-dcp that you can use to build one of the container demos.
The recipe builds a DCP in two flavors by default:
-
an LXC container
-
an OCI-type (Podman/Docker) container
Before proceeding, make sure your project is configured for building containers.
To build one of the demos:
-
Set variable
DCP_NAMEin your project’sconf/local.confto the name of one of the preconfigured demos. For instance, for the lvgl-demo:conf/local.confDCP_NAME = "lvgl-demo" -
Build the recipe:
$ bitbake dey-image-dcp
This generates two artifacts on your deploy directory:
-
lvgl-demo-lxc-ccimx95-dvk.tar.gz -
lvgl-demo-podman-ccimx95-dvk.tar.gz
Install a DCP
Refer to Step 4 - Deploy and run the container for instructions to deploy, install, and run a DCP on your device.
|
The size of a DCP (essentially a compressed Always verify enough storage is available before installation. |