> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Build in a Containerized Environment

The [Yocto Build Guide](./build-qualcomm-linux) covers how to build a stable and
validated version of `meta-qcom` directly on the host. This guide explains
how to run the same build inside a Docker container using `kas-container`,
which eliminates the need to install Yocto build dependencies on your host
machine and ensures a consistent, reproducible build environment.

## Prerequisites

* `kas-container` requires Docker to be installed and running on your host.
  Follow the official Docker documentation to get set up
  * [Install Docker Engine](https://docs.docker.com/engine/install/)
  * [Post-installation steps for Linux](https://docs.docker.com/engine/install/linux-postinstall/) — add your user to the `docker` group so you can run Docker without `sudo`

* `kas-container` is a wrapper script that ships alongside `kas`. When you
  install `kas` using `pipx` (as described in the [Host Setup](./build-qualcomm-linux#host-setup)
  section of the Yocto Build Guide), `kas-container` is installed automatically
  into the same environment and is available on your `PATH`. Confirm if
  `kas-container` is available on the system
  ```bash theme={null}
  kas-container --version
  ```

## Configuration Parameters

The following table describes the build tags for the current release. These
values will be need to be substituted in the build commands.

| Release Tag           | Identifier |
| --------------------- | ---------- |
| meta-qcom-release-tag | qli-2.0    |

## Build Instructions

* Download Qualcomm's Yocto layer `meta-qcom`. For the latest
  `<meta-qcom-release-tag>`, see [Configuration Parameters](#configuration-parameters).

  ```bash theme={null}
  git clone https://github.com/qualcomm-linux/meta-qcom -b <meta-qcom-release-tag>
  ```

- Build the software image using `kas-container`. You define build targets based
  on machine and distro combinations.

  <CodeGroup>
    ```bash IQ-9075-EVK theme={null}
    kas-container build meta-qcom/ci/iq-9075-evk.yml:meta-qcom/ci/qcom-distro.yml
    ```

    ```bash IQ-8275-EVK theme={null}
    kas-container build meta-qcom/ci/iq-8275-evk.yml:meta-qcom/ci/qcom-distro.yml
    ```

    ```bash IQ-615-EVK theme={null}
    kas-container build meta-qcom/ci/iq-615-evk.yml:meta-qcom/ci/qcom-distro.yml
    ```

    ```bash QCS6490 theme={null}
    kas-container build meta-qcom/ci/rb3gen2-core-kit.yml:meta-qcom/ci/qcom-distro.yml
    ```

    ```bash IQ-X7181-EVK theme={null}
    kas-container build meta-qcom/ci/iq-x7181-evk.yml:meta-qcom/ci/qcom-distro.yml
    ```

    ```bash IQ-X5121-EVK theme={null}
    kas-container build meta-qcom/ci/iq-x5121-evk.yml:meta-qcom/ci/qcom-distro.yml
    ```
  </CodeGroup>

* The build creates a single tarball containing all the relevant files to
  perform a full clean flash, including partition metadata, boot firmware,
  ESP partition and the rootfs. After a successful build, check if the
  qcomflash tarball exists in the build artifacts. The following examples
  use `qcom-multimedia-proprietary-image` as the image name.

  <CodeGroup>
    ```bash IQ-9075-EVK theme={null}
    ls build/tmp/deploy/images/iq-9075-evk/qcom-multimedia-proprietary-image-iq-9075-evk.rootfs.qcomflash.tar.gz
    ```

    ```bash IQ-8275-EVK theme={null}
    ls build/tmp/deploy/images/iq-8275-evk/qcom-multimedia-proprietary-image-iq-8275-evk.rootfs.qcomflash.tar.gz
    ```

    ```bash IQ-615-EVK theme={null}
    ls build/tmp/deploy/images/iq-615-evk/qcom-multimedia-proprietary-image-iq-615-evk.rootfs.qcomflash.tar.gz
    ```

    ```bash QCS6490 theme={null}
    ls build/tmp/deploy/images/rb3gen2-core-kit/qcom-multimedia-proprietary-image-rb3gen2-core-kit.rootfs.qcomflash.tar.gz
    ```

    ```bash IQ-X7181-EVK theme={null}
    ls build/tmp/deploy/images/iq-x7181-evk/qcom-multimedia-proprietary-image-iq-x7181-evk.rootfs.qcomflash.tar.gz
    ```

    ```bash IQ-X5121-EVK theme={null}
    ls build/tmp/deploy/images/iq-x5121-evk/qcom-multimedia-proprietary-image-iq-x5121-evk.rootfs.qcomflash.tar.gz
    ```
  </CodeGroup>
