# Run Docker containers

Qualcomm Linux enables Docker containers. To use Docker containers, ensure that Qualcomm
board support package (BSP) has enabled the virtualization features. Enable the `meta-virtualization`
layer in your workspace to use containers on Qualcomm Linux devices.

## Verify the status of the Docker daemon

The `qcom-multimedia-image` enables Docker.

For the `qcom-multimedia-image` image recipe,
`packagegroup-container` is included using
`meta-qcom-distro/recipes-products/images/qcom-multimedia-image.bb`.
The `packagegroup-container` is defined in the `meta-virtualization` layer at
`recipes-core/packagegroups/packagegroup-container.bb`.
After the image is built and flashed, Docker and all its prerequisites and dependencies are available on the device.

To verify the status of the Docker daemon, run the following command and verify the output:

> 
> 
> | Command | Description | Output |
> | --- | --- | --- |
> | `systemctl status docker` | If Docker commands have been run at least once after boot-up | `Active` (running) |
> | `systemctl status docker` | If the device has not run any Docker commands after boot-up | `Inactive` (stopped) |
> |  |  |  |

The images pulled from the Docker repository for the `linux/arm64` platform and tested to run successfully on the device are as follows:

> 
> 
> - `busybox`
> - `python`
> - `alpine`
> - `ubuntu`
> - `postgres`
> - `mongo`
> - `nginx`
> - `redis`

The following use cases are verified with Docker enabled:

- Load Docker images from tar files using the Docker load utility.
- Build a Docker image from the Docker file.
- Save Docker images that were pulled/built into a `.tar` file.
- Load Docker images, which are saved as `.tar` files.
- Run multiple container instances of multiple images pulled/built.
- Verify the list of Docker images loaded on the device.
- Verify the list of active and total containers on the device.
- Inspect Docker images using the Docker inspect utility.
- Obtain logs from a container using the Docker logs utility.
- Stop and kill the container using the Docker stop and Docker kill utilities.
- Remove containers and Docker images from the device.

## Hardware node access from Docker

The applications running inside a Docker container may need access to device nodes and
files on the device (because the device is the host for the Docker container).
Following are the two approaches:

1. Pass the respective device nodes as an option with the run command for Docker to perform this task:

docker run -it --rm --device=<device-1> --device=<device-2> <docker-image-name>
        Copy to clipboard

    Pass the device nodes located in the `/dev` directory on the device.
Depending on the use case, for example, in a graphics scenario, pass
`/dev/kgsl-3d0` to Docker using `--device=/dev/kgsl-3d0`.

    Applications running inside a Docker container may also need access to storage on the device (target-host).
To expose files and directories as bind mounts, run the following command:

docker run -it --rm --mount type=bind,source=<source-path-on-device>,target=<destination-path-inside-container> <docker-image-name>
        Copy to clipboard

    Run a docker container to expose multiple directories, files, and
device nodes to the container using the following command:

docker run -it --rm --device=<device-1> --device=<device-2> --mount type=bind,source=<source-path-on-device-1>,target=<destination-path-inside-container-1>  --mount type=bind,source=<source-path-on-device-2>,target=<destination-path-inside-container-2> <docker-image-name>
        Copy to clipboard
2. Use the container device interface (CDI) to create a CDI JSON/YAML file and place it in the following location:

/etc/cdi/ (persistent)
        /var/run/cdi/ (dynamic, auto-generated)
        Copy to clipboard

    Use the following command to run a container with a CDI device:

docker run -it --device <vendor.com/device-kind>=<cdi-device-name> <image> <command>
        Copy to clipboard

## Run Docker Compose on Qualcomm Linux devices

Docker Compose is a tool for defining and running multi-container applications.
It streamlines managing the application stack by defining services, networks,
and volumes in a single, comprehensible YAML configuration file. By default,
the Qualcomm Linux release includes Docker Compose in `qcom-multimedia-image`.

The `docker-compose` package is added to the `qcom-multimedia-image` in the `meta-qcom-distro` metadata layer.

To know more about Docker Compose, see [Docker Compose overview](https://docs.docker.com/compose).

**To run Docker Compose on the device:**

1. Create or copy the Docker Compose YAML files under the writable path on a
device such as `/var` (for example `/var/docker-compose-yaml`)
to be used with Docker Compose on the device.
2. Ensure that the Docker images listed in your Docker Compose YAML
files are available on the device. If not, the device should be
connected to a valid Internet connection to pull the docker images.
3. To run Docker Compose for multiple YAML files, run the following
command:

docker compose -f <docker-compose-file-1>.yml -f <docker-compose-file-2>.yml up
        Copy to clipboard

    Docker Compose runs and initiates the Docker containers as configured
in the Docker Compose YAML file.
4. After the Docker Compose command returns, run `docker ps -a` and `docker logs <container-id>` to
verify if the docker containers are running as expected.

Last Published: May 10, 2026

[Previous Topic
Persist partition](https://docs.qualcomm.com/bundle/publicresource/80-80022-27/topics/persist_partition.md) [Next Topic
Set up Kubernetes with Qualcomm Linux](https://docs.qualcomm.com/bundle/publicresource/80-80022-27/topics/setup_kubernetes_with_qualcomm_linux.md)

Source: [https://docs.qualcomm.com/doc/80-80022-27/topic/run_docker_containers.html](https://docs.qualcomm.com/doc/80-80022-27/topic/run_docker_containers.html)