# Using `podman compose` with ROS2 - [Compose file reference](https://docs.docker.com/reference/compose-file/) - [Version and name top-level elements](https://docs.docker.com/reference/compose-file/version-and-name/) - [**Services top-level elements**](https://docs.docker.com/reference/compose-file/services/) ## Prerequisites ````{tabs} ```{code-tab} bash {{ arch_based }} sudo pacman -S podman podman-compose ``` ```{code-tab} bash {{ debian_based }} TODO ``` ```` ### NVIDIA #### Install NVIDIA Container Toolkit - [Installing the NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html) ````{tabs} ```{code-tab} bash {{ arch_based }} sudo pacman -S nvidia-container-toolkit ``` ```{code-tab} bash {{ debian_based }} TODO ``` ```` #### Configure Container Device Interface (CDI) ````{tabs} ```{tab} podman - [Support for Container Device Interface](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/cdi-support.html) ``` ```{tab} docker TODO ``` ```` ````{tabs} ```{code-tab} bash podman # Generate config: sudo nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yaml # (optional) Test config: nvidia-ctk cdi list ``` ```{code-tab} bash docker TODO ``` ```` ## ROS2 Docker images - [GitHub: osrf/docker_images](https://github.com/osrf/docker_images) ## Compose file library How to use any of the following `compose.yaml` files: 1. Download the desired `compose.yaml` file. 2. Make new directory, preferably with descriptive name (e.g. `ros2_jazzy_desktop`) and move downloaded file to newly created directory. 3. `cd` to direcory created in step 2 and run desired command (found under usage). ## ROS2 ### Jazzy #### Base [`compose.yaml`](./compose_files/ros2_base/compose.yaml) ```{literalinclude} ./compose_files/ros2_base/compose.yaml --- lines: -15 --- ``` **Usage** ```bash podman compose run --rm jazzy_base bash ``` #### Desktop [`compose.yaml`](./compose_files/ros2_desktop/compose.yaml) ```{literalinclude} ./compose_files/ros2_desktop/compose.yaml ``` **Usage** ```bash podman compose run --rm jazzy_desktop bash ```