Skip to main content

Versioned CLI and Python API for building and running ROS 2 Docker workspaces.

Project description

ros2docker

pr-lightweight nightly-e2e

ros2docker is a versioned Python CLI and API for building and running ROS 2 Docker workspaces from JSON-with-comments config files.

Install

Stable release:

pipx install ros2docker

Latest development version:

pipx install --force git+https://github.com/develNor/ros2docker.git@main

Non-pipx fallback:

python3 -m pip install --user ros2docker

Development Install

When developing ros2docker, install this checkout in editable mode so the host ros2docker command imports the local source:

pipx install --force --editable /path/to/ros2docker

Normal Python source changes are picked up immediately by new ros2docker commands. Reinstall after changing package metadata, dependencies, or console entry points in pyproject.toml.

Verify the editable command with:

ros2docker run --no-build --dry-run -m .

The dry run should print a docker run command that mounts the current directory as /ws and starts bash, without requiring -f/--config.

CLI

ros2docker run -m /host/project
ros2docker run --no-build -m /host/project
ros2docker build -f ros2docker.json
ros2docker run -f ros2docker.json
ros2docker run -f ros2docker.json --no-build -- -v /host/data:/data
ros2docker stop -f ros2docker.json
ros2docker exec -f ros2docker.json -- bash -lc 'ros2 --help'
ros2docker --version
python -m ros2docker --version

Every Docker action accepts --dry-run, which prints the Docker argv and exits without running Docker. The -f/--config option is optional; without it, ros2docker uses the default config, which starts an interactive Bash shell.

Config

Config files are JSON with // and /* ... */ comments. Supported keys include:

{
  "container_name": "example_ros2container",
  "image_name": "ros2docker",
  "run_type": "bash",
  "mount_ws": true,
  "enable_gui_forwarding": false,
  "forward_ssh_agent": false,
  "run_args": [],
  "extra_run_args": [],
  "build_args": {},
  "bake_ros_packages": [],
  "catmux_file": "/ws/catmux.yaml",
  "catmux_params": {},
  "command": "ros2 topic list"
}

The machine-readable schema lives at src/ros2docker/resources/schema/ros2docker.schema.json. See docs/configuration.md for the full configuration contract. Unknown top-level config keys are rejected.

Supported run_type values are:

  • bash: start an interactive shell.
  • command: run the configured command.
  • catmux: start a catmux session from catmux_file.
  • up: start a detached keepalive container.

Host paths in -v/--volume and bind --mount args expand ~ and environment variables. Relative ./ and ../ host paths are resolved from the config file directory.

bake_ros_packages paths are also resolved from the config file directory and copied into a temporary Docker build context. The installed Python package directory is never mutated during builds.

enable_gui_forwarding forwards the X11 socket at /tmp/.X11-unix. forward_ssh_agent forwards the host SSH_AUTH_SOCK path when the variable is set and points to an existing socket or file.

Development

For contributor setup, local checks, PR modes, merge policy, and release workflow, see CONTRIBUTING.md. CI behavior is summarized in docs/ci.md, and release publishing is summarized in docs/release.md.

Python API

from ros2docker.api import build, run, build_run, stop, exec_shell
from ros2docker.config import load_config, get_config_dir
from ros2docker.commands import make_build_command, make_run_command

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ros2docker-0.1.1.tar.gz (24.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ros2docker-0.1.1-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file ros2docker-0.1.1.tar.gz.

File metadata

  • Download URL: ros2docker-0.1.1.tar.gz
  • Upload date:
  • Size: 24.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ros2docker-0.1.1.tar.gz
Algorithm Hash digest
SHA256 085a23445cdde47b293a47d2830296a0c9fe960076c94b412deb85fcbf441da2
MD5 f5f532d845005edc11fb5a34a8eef915
BLAKE2b-256 4102ad7b00ed9e845fb343479ed26d82c35ecb9271f0af06ee4569519c5a7053

See more details on using hashes here.

Provenance

The following attestation bundles were made for ros2docker-0.1.1.tar.gz:

Publisher: release.yml on develNor/ros2docker

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ros2docker-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: ros2docker-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 18.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ros2docker-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9036dfaeae654df793d6c9bf719e371258eeba4175c554baa2090de187808d2b
MD5 dddaa65b565d348316f122bfb4f3a986
BLAKE2b-256 14d6611f8105c8e1d8059d9c0386e9326bf5749f17ff600c104b2886241faed6

See more details on using hashes here.

Provenance

The following attestation bundles were made for ros2docker-0.1.1-py3-none-any.whl:

Publisher: release.yml on develNor/ros2docker

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page