Software Containers
Containerization.SoftwareContainers is a unified pattern module used for identifying container runtime, executing appropriate commands, and modeling the SoftwareInstance, SoftwareContainer, and ContainerImage node kinds.
With the introduction of Containerization.SoftwareContainers in TKU June 2025, the following container-related patterns were deprecated (however, the corresponding containerd SoftwareInstances are still modeled):
For more information about the containers discovery approach, see theofficial BMC Helix Discovery documentation.
Components
The pattern module consists of the following major components:
Runtime functions
The following pattern local functions are used to obtain the containers and image details:
- common
- containerd
- crictl
- crio
- crun
- ctr
- docker
- nerdctl
- podman
- runc
Common functions
The following pattern local common functions are used to build container context tables, extract various data builds, and destroy nodes:
- buildContext
- createManagementRelationships
- createNodes
- dirname
- extractCRIAnnotations
- extractTagValues
- finalizeContainerData
- finalizeImageData
- getDiscoveryUID
- getProductVersion
- initContainerData
- initImageData
- removeOldNodes
- splitRepoDigest
- splitRepoTag
- updateContainerImageIds
- updateFromRepoValues
- validateOutput
Patterns
LinuxHost—The LinuxHost pattern is triggered by the Host node where the platform is Linux and detects software containers.
Platforms supported by the pattern
The pattern currently supports only Linux hosts.
Commands executed by the pattern
The following table gives details about commands that are executed by the Containerization.SoftwareContainers pattern module:
Runtime | Command | Goal |
crun | id -u | Obtain the BMC Helix Discovery user ID. |
crun list --format json 2>/dev/null | List the running containers. | |
PRIV_RUNCMD crun list --format json 2>/dev/null | List the running containers with privilege elevation. | |
PRIV_RUNCMD runuser -l $(id -un %uid%) -c crun list --format json 2>/dev/null | List the running containers under a different user. | |
Docker | docker inspect $(docker ps -q 2>/dev/null) 2>/dev/null | List the running containers. |
PRIV_RUNCMD docker inspect $(PRIV_RUNCMD docker ps -q 2>/dev/null) 2>/dev/null | List the running containers with privilege elevation. | |
docker image inspect $(docker images -q 2>/dev/null) 2>/dev/null | List the images. | |
PRIV_RUNCMD docker image inspect $(PRIV_RUNCMD docker images -q 2>/dev/null) 2>/dev/null | List the images with privilege elevation. | |
docker node ls --format '{{.ID}} : {{.Hostname}} : {{.ManagerStatus}} | Detect a Swarm and obtain node details. | |
docker node ls | awk '{if (NR!=1) {if ($2 == "*") {printf("%s : %s : %s\n", $1, $3, $NF);} else {printf("%s : %s : %s\n", $1, $2, $NF);}}}' | Detect a Swarm and obtain node details when the Docker node ls doesn't support --format. | |
docker version | Obtain the version and verify the runtime. | |
<binary_path>/dockerd --version | Obtain the version and verify the runtime. | |
Podman | id -u | Obtain the BMC Helix Discovery user ID. |
podman ps --no-trunc --format json 2>/dev/null | List the running containers. | |
PRIV_RUNCMD podman ps --no-trunc --format json 2>/dev/null | List the running containers with privilege elevation. | |
PRIV_RUNCMD runuser -l $(id -un %uid%) -c podman ps --no-trunc --format json 2>/dev/null | List the running containers under a different user. | |
podman ps --no-trunc --format json 2>/dev/null | List the images. | |
PRIV_RUNCMD podman ps --no-trunc --format json 2>/dev/null | List the images with privileges. | |
PRIV_RUNCMD runuser -l $(id -un %uid%) -c podman ps --no-trunc --format json 2>/dev/null | List the images under a different user. | |
podman info | Obtain the configuration. | |
nerdctl | nerdctl --namespace %namespace% ps --no-trunc -q 2>/dev/null | List the running containers. |
PRIV_RUNCMD nerdctl --namespace %namespace% ps --no-trunc -q 2>/dev/null | List the running containers with privilege elevation. | |
nerdctl inspect %container_id% 2>/dev/null | Obtain the details of each container. | |
PRIV_RUNCMD nerdctl inspect %container_id% 2>/dev/null | List the running containers with privilege elevation. | |
nerdctl image inspect $(nerdctl --namespace %namespace% images -q 2>/dev/null | sort -u) 2>/dev/null | List the images. | |
nerdctl version | Obtain the version and verify the runtime. | |
PRIV_RUNCMD nerdctl version | Obtain the version and verify the runtime (with privileged execution). | |
crictl | crictl ps --output json 2>/dev/null | List the running containers. |
PRIV_RUNCMD crictl ps --output json 2>/dev/null | List the running containers with privilege elevation. | |
crictl images --digests --no-trunc --output json 2>/dev/null | List the images. | |
PRIV_RUNCMD crictl images --digests --no-trunc --output json 2>/dev/null | List the images with privilege elevation. | |
crictl version | Obtain the version and verify the runtime. | |
PRIV_RUNCMD crictl version | Obtain the version and check the runtime with privilege elevation. | |
CRI-O | cri-o --version | Obtain the version. |
cri-o config | Obtain the configuration. | |
ctr | ctr --namespace <namespace> task list 2>/dev/null | List the running containers. |
PRIV_RUNCMD ctr --namespace <namespace> task list 2>/dev/null | List the running containers with privilege elevation. | |
ctr --namespace %namespace% container info %container_id% 2>/dev/null | Obtain the container details of each container_id. | |
PRIV_RUNCMD ctr --namespace %namespace% container info %container_id% 2>/dev/null | Obtain the container details of each container_id (with privileged execution). | |
ctr --namespace %namespace% image list 2>/dev/null | List the images. | |
PRIV_RUNCMD ctr --namespace %namespace% image list 2>/dev/null | List the images with privilege elevation. | |
ctr version | Obtain the version and check the runtime. | |
PRIV_RUNCMD ctr version | Obtain the version and verify the runtime with privilege elevation. | |
runc | runc --root <root> list --format json 2>/dev/null | List the running containers. |
PRIV_RUNCMD runc --root <root> list --format json 2>/dev/null | List the running containers with privilege elevation. |
Nodes modeled by the pattern
The Containerization.SoftwareContainers pattern module models the following nodes:
Software Instance
The Containerization.SoftwareContainers pattern models the Software Instance node kinds of the following types:
Runtime | containerd | CRI-O | Docker | Podman |
Attributes |
|
|
|
|
Software Container
The Containerization.SoftwareContainers pattern module models the Software Container node kinds of the following types:
- key = <host.key>/<container_id>,
- name
- type = "Linux Container",
- short_name
- count
- image_id
- image
- image_digest
- container_name
- container_id
- contained_pid
- pod_id
- pod_name
- pod_namespace
- listening_ports
Container Image
The Containerization.SoftwareContainers pattern models the Container Image node kinds of the following types:
- key= <digest> or key=<repo_tags[0]>
- id
- name
- short_name
- digest
- repository
- repo_digests
- repo_tags
- tag
- tag_set