Skip to content

Docker Containers on AIR-T

Docker is a powerful platform for developing, shipping, and running applications in containers. One of the key benefits of using Docker is its ability to enhance application portability. Containers encapsulate an application and its dependencies, ensuring consistency across different environments, from development to production. This tutorial will demonstrate how to set up and run a docker container on your AIR-T that has properly exposed the radio drivers to the container.

This tutorial assumes you are running Airstack version 2.X. If you are running AirStack 1.0 or earlier you can find the tutorial here.

Docker Setup

User Permissions

If your user is not part of the Docker group on your system you can add it by running the command below and then logging out / back in. sudo usermod -aG docker <their user name>. Running docker as sudo is not an advised solution by Deepwave.

  1. Create the AirStack Dockerfile - Below is an example file to use Python 3.10 on AirStack 2.X, but feel free to add your own package requirements. Things to note:

    • Your container must install the packages soadysdr-tools and uhd-host to be able to control the radio.

    • The provided Dockerfile is a minimal solution if you just want to run the radio without any other GPU-accelerated frameworks installed. If you want to use CUDA or other JetPack libraries, please see this table for recommended images:

    ARG BASE_IMAGE=ubuntu:22.04
    FROM ${BASE_IMAGE}
    
    # Don't allow apt-get to prompt user when building a container
    ARG DEBIAN_FRONTEND=noninteractive
    
    # Basic setup to start installing packages:
    RUN apt-get update && apt-get install -y --no-install-recommends \
    ca-certificates gnupg2 curl git-core \
    && rm -rf /var/lib/apt/lists/* && apt-get clean
    
    # Required for Airstack Install
    RUN apt-get update && apt-get install -y --no-install-recommends \
    python3-all-dev \ 
    soapysdr-tools \
    uhd-host
    
    # Install Python 3.10 [Optional]
    RUN apt-get update && apt-get install -y --no-install-recommends \
    python3.10 \
    python3.10-venv
    
    # Required environment variables for CUDA
    ENV CUDA_HOME="/usr/local/cuda"
    ENV PATH="/usr/local/cuda/bin:${PATH}"
    ENV LD_LIBRARY_PATH="/usr/local/cuda/lib64:${LD_LIBRARY_PATH}"
    
    # Required environment variables for non-NVIDIA base images
    ENV NVARCH=arm64
    ENV NVIDIA_REQUIRE_JETPACK_HOST_MOUNTS=base-only
    ENV NVIDIA_VISIBLE_DEVICES=all
    ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility 
    
  2. Build the Docker Container using the typical commands:

    docker build --platform=linux/arm64 -t air_docker .
    
    where the -t air_docker is the tag associated with the new container.

  3. Run the Container :

    Note: The container must be run with the "privileged" flag to be able to control the radio: ```bash docker run -it --privileged air_docker:latest ````

Extra Information

Alternate Base Images

Image Usage
ubuntu:22.04 Radio only without any other GPU-accelerated frameworks installed
nvcr.io/nvidia/l4t-cuda:12.611-runtime GPU/CUDA applications. For more information, click here
nvcr.io/nvidia/l4t-tensorrt:r10.3.0-devel GPU/CUDA and TensorRT applications. For more information, click here