Using podman compose with ROS2¶
Prerequisites¶
sudo pacman -S podman podman-compose
TODO
NVIDIA¶
Install NVIDIA Container Toolkit¶
sudo pacman -S nvidia-container-toolkit
TODO
Configure Container Device Interface (CDI)¶
# Generate config:
sudo nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yaml
# (optional) Test config:
nvidia-ctk cdi list
TODO
ROS2 Docker images¶
Compose file library¶
How to use any of the following compose.yaml files:
Download the desired
compose.yamlfile.Make new directory, preferably with descriptive name (e.g.
ros2_jazzy_desktop) and move downloaded file to newly created directory.cdto direcory created in step 2 and run desired command (found under usage).
ROS2¶
Jazzy¶
Base¶
name: "ros2-base"
services:
jazzy_base:
image: "ros:jazzy-ros-base"
hostname: "ThinkBook-16p"
privileged: true
security_opt:
- "label:disable"
- "apparmor:unconfined"
pids_limit: -1
ipc: "host"
network_mode: "host"
pid: "host"
command: "sleep infinity"
Usage
podman compose run --rm jazzy_base bash
Desktop¶
name: "ros2-desktop"
services:
jazzy_desktop:
image: "osrf/ros:jazzy-desktop-full"
hostname: "JazzyDesktop-container"
privileged: true
security_opt:
- label:disable
- apparmor:unconfined
pids_limit: -1
ipc: "host"
network_mode: "host"
pid: "host"
environment:
DISPLAY: ${DISPLAY}
XDG_RUNTIME_DIR: ${XDG_RUNTIME_DIR}
XAUTHORITY: ${XAUTHORITY}
# WAYLAND_DISPLAY: wayland-0
volumes:
- "/run/user/1000:${XDG_RUNTIME_DIR}:rslave"
command: "sleep infinity"
Usage
podman compose run --rm jazzy_desktop bash