ika-rwth-aachen/docker-ros
docker-ros automatically builds development and deployment Docker images for your ROS-based repositories
Science Score: 62.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
12 of 14 committers (85.7%) from academic institutions -
✓Institutional organization owner
Organization ika-rwth-aachen has institutional domain (www.ika.rwth-aachen.de) -
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.2%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
docker-ros automatically builds development and deployment Docker images for your ROS-based repositories
Basic Info
Statistics
- Stars: 171
- Watchers: 5
- Forks: 21
- Open Issues: 3
- Releases: 17
Topics
Metadata Files
README.md

docker-ros – Automated Containerization of ROS Apps
docker-ros automatically builds minimal container images of ROS applications.
[!IMPORTANT]
This repository is open-sourced and maintained by the Institute for Automotive Engineering (ika) at RWTH Aachen University.
DevOps, Containerization and Orchestration of Software-Defined Vehicles are some of many research topics within our Vehicle Intelligence & Automated Driving domain.
If you would like to learn more about how we can support your advanced driver assistance and automated driving efforts, feel free to reach out to us!
:email: opensource@ika.rwth-aachen.de
We recommend to use docker-ros in combination with our other tools for Docker and ROS.
- docker-ros-ml-images provides machine learning-enabled ROS Docker images
- docker-run is a CLI tool for simplified interaction with Docker images
About
docker-ros provides a generic Dockerfile that can be used to build development and deployment Docker images for arbitrary ROS packages or package stacks. Building such images can easily be automated by integrating docker-ros into CI through the provided GitHub action or GitLab CI template. The development image built by docker-ros contains all required dependencies and the source code of your ROS-based repository. The deployment image only contains dependencies and the compiled binaries created by building the ROS packages in the repository. docker-ros is also able to build multi-arch Docker images for amd64 and arm64 architectures. In addition, slim is integrated for slimming Docker image size of the deployment image by up to 30x (see Slim Deployment Image).
The Dockerfile performs the following steps to build these images:
1. All dependency repositories that are defined in a .repos file anywhere in the repository are cloned using vcstool.
2. (optional) Packages blacklisted in a special file blacklisted-packages.txt are removed from the workspace (see Advanced Dependencies).
3. (optional) A special script before_dependency_installation.sh is executed to perform arbitrary installation commands, if needed (see Advanced Dependencies).
4. The ROS dependencies listed in each package's package.xml are installed by rosdep.
5. (optional) Additional apt dependencies from a special file additional-debs.txt are installed, if needed (see Advanced Dependencies).
6. (optional) Additional pip requirements from a special file additional-pip-requirements.txt are installed, if needed (see Advanced Dependencies).
7. (optional) A special folder additional-files/ is copied into the images, if needed (see Advanced Dependencies).
8. (optional) A special script custom.sh is executed to perform arbitrary installation commands, if needed (see Advanced Dependencies).
9. (deployment) All ROS packages are built using colcon (ROS2).
10. (deployment) A custom launch command is configured to run on container start.
Prerequisites
docker-ros is made for automated execution in GitHub or GitLab CI pipelines. For local execution, see Build images locally.
GitHub
GitHub offers free minutes on GitHub-hosted runners executing GitHub Actions, [see here](https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions). No further setup is required other than integrating *docker-ros* into your repository, see [*Usage*](#usage). Note that GitHub is currently only offering Linux runners based on the *amd64* architecture. *docker-ros* can also build multi-arch Docker images solely on the *amd64* platform through emulation, but performance can be improved greatly by deploying [self-hosted runners](https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners) for the *arm64* platform.GitLab
> [!NOTE] > - GitLab runners must be based on the Docker executor, [see here](https://docs.gitlab.com/runner/executors/docker.html) > - GitLab runners must run in privileged mode for Docker-in-Docker, [see here](https://docs.gitlab.com/runner/executors/docker.html#use-docker-in-docker-with-privileged-mode) > - GitLab runners must be tagged with tags `privileged` and either `amd64` or `arm64` depending on their architecture GitLab offers free minutes on GitLab-hosted runners executing GitLab CI pipelines on [gitlab.com](https://gitlab.com), [see here](https://docs.gitlab.com/runner/#use-gitlabcom-saas-runners). On self-hosted GitLab instances, you can set up self-hosted runners, [see here](https://docs.gitlab.com/runner/#use-self-managed-runners). Note that GitLab is currently only offering Linux runners based on the *amd64* architecture. *docker-ros* can also build multi-arch Docker images solely on the *amd64* platform through emulation, but performance can be improved greatly by deploying [self-hosted runners](https://docs.gitlab.com/runner/#use-self-managed-runners) for the *arm64* platform.Usage
docker-ros can easily be integrated into any GitHub or GitLab repository containing ROS packages. Example integrations can be found in the following sections. Configuration options can be found here. For local execution, see Build images locally.
GitHub
*docker-ros* provides a [GitHub action](action.yml) that can simply be added to a job via the [`jobs.GitLab
*docker-ros* provides a [GitLab CI template](.gitlab-ci/docker-ros.yml) that can simply be included in a [`.gitlab-ci.yml`](https://docs.gitlab.com/ee/ci/yaml/gitlab_ci_yaml.html) file. A quick start for GitLab CI is found [here](https://docs.gitlab.com/ee/ci/quick_start/).Build a minimal image for deployment
GitHub
```yml on: push jobs: docker-ros: runs-on: ubuntu-latest steps: - uses: ika-rwth-aachen/docker-ros@v1.8.1 with: base-image: rwthika/ros2:jazzy command: ros2 run my_pkg my_node ```GitLab
```yml include: - remote: https://raw.githubusercontent.com/ika-rwth-aachen/docker-ros/v1.8.1/.gitlab-ci/docker-ros.yml variables: BASE_IMAGE: rwthika/ros2:jazzy COMMAND: ros2 run my_pkg my_node ```Build development and deployment images
GitHub
```yml on: push jobs: docker-ros: runs-on: ubuntu-latest steps: - uses: ika-rwth-aachen/docker-ros@v1.8.1 with: base-image: rwthika/ros2:jazzy command: ros2 run my_pkg my_node target: dev,run ```GitLab
```yml include: - remote: https://raw.githubusercontent.com/ika-rwth-aachen/docker-ros/v1.8.1/.gitlab-ci/docker-ros.yml variables: BASE_IMAGE: rwthika/ros2:jazzy COMMAND: ros2 run my_pkg my_node TARGET: dev,run ```Build multi-arch images
GitHub
```yml on: push jobs: docker-ros: runs-on: ubuntu-latest steps: - uses: ika-rwth-aachen/docker-ros@v1.8.1 with: base-image: rwthika/ros2:jazzy command: ros2 run my_pkg my_node target: dev,run platform: amd64,arm64 ```GitLab
```yml include: - remote: https://raw.githubusercontent.com/ika-rwth-aachen/docker-ros/v1.8.1/.gitlab-ci/docker-ros.yml variables: BASE_IMAGE: rwthika/ros2:jazzy COMMAND: ros2 run my_pkg my_node TARGET: dev,run PLATFORM: amd64,arm64 ```Build deployment image with additional industrial_ci check
GitHub
```yml on: push jobs: docker-ros: runs-on: ubuntu-latest steps: - uses: ika-rwth-aachen/docker-ros@v1.8.1 with: base-image: rwthika/ros2:jazzy command: ros2 run my_pkg my_node enable-industrial-ci: 'true' ```GitLab
```yml include: - remote: https://raw.githubusercontent.com/ika-rwth-aachen/docker-ros/v1.8.1/.gitlab-ci/docker-ros.yml variables: BASE_IMAGE: rwthika/ros2:jazzy COMMAND: ros2 run my_pkg my_node ENABLE_INDUSTRIAL_CI: 'true' ```Build multi-arch images on arch-specific self-hosted runners in parallel
GitHub
```yml on: push jobs: docker-ros: strategy: matrix: target: [dev, run] platform: [amd64, arm64] runs-on: [self-hosted, "${{ matrix.platform }}"] steps: - uses: ika-rwth-aachen/docker-ros@v1.8.1 with: base-image: rwthika/ros2:jazzy command: ros2 run my_pkg my_node target: ${{ matrix.target }} platform: ${{ matrix.platform }} enable-singlearch-push: true # TODO: manifest ```GitLab
```yml # TODO ```Build images locally
docker-ros can build Docker images locally by executing the build.sh script.
- Clone docker-ros as a Git submodule to
docker/docker-rosin your repository.bash # ros-repository/ mkdir -p docker git submodule add https://github.com/ika-rwth-aachen/docker-ros.git docker/docker-ros - Configure the build using the same environment variables as used for GitLab CI and run
build.sh, e.g.:bash # ros-repository/ BASE_IMAGE="rwthika/ros2:jazzy" \ COMMAND="ros2 run my_pkg my_node" \ IMAGE="my-image:latest" \ ./docker/docker-ros/scripts/build.sh> [!NOTE]
> You can alternatively store your environment variable configuration in a.envfile: >bash > # .env > BASE_IMAGE="rwthika/ros2:jazzy" > COMMAND="ros2 run my_pkg my_node" > IMAGE="my-image:latest" >
Advanced Dependencies
In order to keep things organized, we recommend to place all docker-ros related files in a docker folder on top repository level.
Recursion
Most of the steps listed in About and below can be toggled between recursive and non-recursive mode, see Configuration Variables. This usually means that not only special files on the top-level are considered (e.g., docker/additional-requirements.txt), but also files with the same name (e.g., additional-requirements.txt) that are found anywhere in the workspace, even after cloning the upstream repositories in step 1.
Package Blacklist
If your ROS-based repository (or any of your repository's upstream dependencies, see .repos) contains ROS packages that should neither be built nor be used for determining dependencies, you can blacklist those in a special blacklisted-packages.txt file.
Create a file blacklisted-packages.txt in your docker folder (or configure a different BLACKLISTED_PACKAGES_FILE) and list any ROS package name to blacklist.
Extra System Dependencies (apt)
If your ROS-based repository requires system dependencies that cannot be installed by specifying their rosdep keys in a package.xml, you can use a special additional-debs.txt file.
Create a file additional-debs.txt in your docker folder (or configure a different ADDITIONAL_DEBS_FILE) and list any other dependencies that need to be installed via apt.
Extra System Dependencies (pip)
If your ROS-based repository requires Python dependencies that cannot be installed by specifying their rosdep keys in a package.xml, you can use a special additional-pip-requirements.txt file.
Create a file additional-pip-requirements.txt in your docker folder (or configure a different ADDITIONAL_PIP_FILE) and list any other Python dependencies that need to be installed via pip.
Custom Installation Scripts
If your ROS-based repository requires to execute any other installation or pre-/post-installation steps, you can specify multiple custom scripts that are executed during the image building process. See the configuration variable documentation for the following variables.
- BEFORE_DEPENDENCY_IDENTIFICATION_SCRIPT
- BEFORE_DEPENDENCY_INSTALLATION_SCRIPT
- AFTER_DEPENDENCY_INSTALLATION_SCRIPT
Create those scripts in your docker folder (or configure different filepaths via the specified environment variables).
Extra Image Files
If you need to have additional files present in the deployment image, you can use a special additional-files folder. The folder contents will be copied into the container before the custom installation script custom.sh is executed.
Create a folder additional-files in your docker folder (or configure a different ADDITIONAL_FILES_DIR) and place any files or directories in it. The contents will be copied to /docker-ros/additional-files in the image.
Additional Information
User Setup
Containers of the provided images start with root user by default. If the two environment variables DOCKER_UID and DOCKER_GID are passed, a new user with the corresponding UID/GID is created on the fly. Most importantly, this features allows to mount and edit files of the host user in the container without having to deal with permission issues.
bash
docker run --rm -it -e DOCKER_UID=$(id -u) -e DOCKER_GID=$(id -g) -e DOCKER_USER=$(id -un) rwthika/ros:latest
The password of the custom user is set to its username (dockeruser:dockeruser by default).
Slim Deployment Image
docker-ros integrates the slim toolkit for minifying container images. slim is enabled by default and will, in addition to the run deployment image, produce an additional :latest-slim-tagged minified image. Note that slim removes every single thing not needed for executing the default launch command. To balance image size and out-of-the-box functionality, the /opt/ros and /docker-ros/ws/install directories are preserved by default. The slimming process can be controlled via the SLIM_BUILD_ARGS configuration variable.
Configuration Variables
[!NOTE]
GitHub Action input | GitLab CI environment variable
additional-debs-file|ADDITIONAL_DEBS_FILE
Relative filepath to file containing additional apt deb packages to install
default:docker/additional-debs.txtadditional-files-dir|ADDITIONAL_FILES_DIR
Relative path to directory containing additional files to copy into image
default:docker/additional-filesadditional-pip-file|ADDITIONAL_PIP_FILE
Relative filepath to file containing additional pip packages to install
default:docker/additional-pip-requirements.txtafter-dependency-installation-script|AFTER_DEPENDENCY_INSTALLATION_SCRIPT
Relative filepath to script containing commands to run after dependency installation
default:docker/custom.shbase-image|BASE_IMAGE
Base imagename:tag
requiredbefore-dependency-identification-script|BEFORE_DEPENDENCY_IDENTIFICATION_SCRIPT
Relative filepath to script containing commands to run before dependency identification
default:docker/before_dependency_identification.shbefore-dependency-installation-script|BEFORE_DEPENDENCY_INSTALLATION_SCRIPT
Relative filepath to script containing commands to run before dependency installation
default:docker/before_dependency_installation.shblacklisted-packages-file|BLACKLISTED_PACKAGES_FILE
Relative filepath to file containing blacklisted packages
default:docker/blacklisted-packages.txtbuild-context|BUILD_CONTEXT
Build context of Docker build process
default:${{ github.workspace }}|.command|COMMAND
Launch command of run image
required iftarget=runcmake-args|CMAKE_ARGS
CMake arguments to pass tocolcon build
default:"-DCMAKE_BUILD_TYPE=Release"dev-image-name|DEV_IMAGE_NAME
Image name of dev image
default:<IMAGE_NAME>dev-image-tag|DEV_IMAGE_TAG
Image tag of dev image
default:<IMAGE_TAG>-devdisable-ros-installation|DISABLE_ROS_INSTALLATION
Disable automatic installation ofros-$ROS_DISTRO-ros-corepackage
e.g., if ROS is already installed inbase-imageand package is not available for the OS
default:false-|DOCKER_ROS_GIT_REF
Git ref of docker-ros to run in CI
default:mainenable-checkout|-
Enable checkout action to (re-)download your repository prior to running the pipeline
default:trueenable-checkout-submodules|-
Enable submodules for the checkout action (false|true|recursive)
default:recursiveenable-checkout-lfs|-
Enable Git LFS support for the checkout action
default:trueenable-industrial-ci|ENABLE_INDUSTRIAL_CI
Enable industrial_ci
default:falseenable-push-as-latest|ENABLE_PUSH_AS_LATEST
Push images with taglatest/latest-devin addition to the configured image names
default:falseenable-singlearch-push|ENABLE_SINGLEARCH_PUSH
Enable push of single arch images with-amd64/-arm64postfix
default:falseenable-recursive-additional-debs|ENABLE_RECURSIVE_ADDITIONAL_DEBS
Enable recursive discovery of files namedadditional-debs-file
default:falseenable-recursive-additional-pip|ENABLE_RECURSIVE_ADDITIONAL_PIP
Enable recursive discovery of files namedadditional-pip-file
default:falseenable-recursive-after-dependency-installation-script|ENABLE_RECURSIVE_AFTER_DEPENDENCY_INSTALLATION_SCRIPT
Enable recursive discovery of files namedafter-dependency-installation-script
default:falseenable-recursive-before-dependency-installation-script|ENABLE_RECURSIVE_BEFORE_DEPENDENCY_INSTALLATION_SCRIPT
Enable recursive discovery of files namedbefore-dependency-installation-script
default:falseenable-recursive-blacklisted-packages|ENABLE_RECURSIVE_BLACKLISTED_PACKAGES
Enable recursive discovery of files namedblacklisted-packages-file
default:falseenable-recursive-vcs-import|ENABLE_RECURSIVE_VCS_IMPORT
Enable recursive discovery of files named*.repos
default:trueenable-slim|ENABLE_SLIM
Enable an extra slimmed run image via slim (only ifrunstage is targeted)
default:truegit-https-password|GIT_HTTPS_PASSWORD
Password for cloning private Git repositories via HTTPS
default:${{ github.token }}|$CI_JOB_TOKENgit-https-server|GIT_HTTPS_SERVER
Server URL (without protocol) for cloning private Git repositories via HTTPS
default:github.com|$CI_SERVER_HOST:$CI_SERVER_PORTgit-https-user|GIT_HTTPS_USER
Username for cloning private Git repositories via HTTPS
default:${{ github.actor }}|gitlab-ci-tokengit-ssh-known-host-keys|GIT_SSH_KNOWN_HOST_KEYS
Known SSH host keys for cloning private Git repositories via SSH (may be obtained usingssh-keyscan)git-ssh-private-key|GIT_SSH_PRIVATE_KEY
SSH private key for cloning private Git repositories via SSHimage-name|IMAGE_NAME
Image name of run image
default:ghcr.io/${{ github.repository }}|$CI_REGISTRY_IMAGEimage-tag|IMAGE_TAG
Image tag of run image default:latestplatform|PLATFORM
Target platform architecture (comma-separated list)
default: runner architecture |amd64supported values:amd64,arm64registry|REGISTRY
Docker registry to push images to
default:ghcr.io|$CI_REGISTRYregistry-password|REGISTRY_PASSWORD
Docker registry password
default:${{ github.token }}|$CI_REGISTRY_PASSWORDregistry-user|REGISTRY_USER
Docker registry username
default:${{ github.actor }}|$CI_REGISTRY_USERrmw-implementation|RMW_IMPLEMENTATION
ROS 2 middleware implementation
default:rmw_fastrtps_cpp
supported values:rmw_zenoh_cpp,rmw_fastrtps_cpp,rmw_cyclonedds_cpp,rmw_gurumdds_cpp, ...ros-distro|ROS_DISTRO
ROS Distro
required if ROS is not installed inbase-image
supported values:rolling, ...,noetic, ...slim-build-args|SLIM_BUILD_ARGS
Arguments toslim build(except for--targetand--tag)
default:--sensor-ipc-mode proxy --continue-after=10 --show-clogs --http-probe=false --include-path /opt/ros --include-path /docker-ros/ws/installslim-image-name|SLIM_IMAGE_NAME
Image name of slim run image
default:<IMAGE_NAME>slim-image-tag|SLIM_IMAGE_TAG
Image tag of slim run image
default:<IMAGE_TAG>-slimtarget|TARGET
Target stage of Dockerfile (comma-separated list)
default:runsupported values:dev,runvcs-import-file|VCS_IMPORT_FILE
Relative filepath to file containing additional repos to install via vcstools (only relevant ifenable-recursive-vcs-import=false)
default:.repos
Owner
- Name: Institut für Kraftfahrzeuge, RWTH Aachen, ika
- Login: ika-rwth-aachen
- Kind: organization
- Location: Aachen, Germany
- Website: https://www.ika.rwth-aachen.de
- Repositories: 16
- Profile: https://github.com/ika-rwth-aachen
Citation (CITATION.cff)
cff-version: 1.2.0
message: "We hope that our tools can help your research. If this is the case, please cite it using the following metadata."
title: dorotos
type: software
repository-code: "https://github.com/ika-rwth-aachen/docker-ros"
date-released: 2023-05-28
authors:
- given-names: Jean-Pierre
family-names: Busch
- given-names: Lennart
family-names: Reiher
preferred-citation:
title: "Enabling the Deployment of Any-Scale Robotic Applications in Microservice-Based Service-Oriented Architectures through Automated Containerization"
type: conference-paper
conference:
name: "2024 IEEE International Conference on Robotics and Automation (ICRA)"
year: 2024
pages: "17650-17656"
doi: "10.1109/ICRA57147.2024.10611586"
url: "https://ieeexplore.ieee.org/document/10611586"
authors:
- given-names: Jean-Pierre
family-names: Busch
orcid: "https://orcid.org/0009-0000-1417-0463"
- given-names: Lennart
family-names: Reiher
orcid: "https://orcid.org/0000-0002-7309-164X"
- given-names: Lutz
family-names: Eckstein
GitHub Events
Total
- Create event: 19
- Release event: 4
- Issues event: 9
- Watch event: 34
- Delete event: 16
- Member event: 3
- Issue comment event: 18
- Push event: 76
- Pull request review event: 62
- Pull request review comment event: 41
- Pull request event: 45
- Fork event: 7
Last Year
- Create event: 19
- Release event: 4
- Issues event: 9
- Watch event: 34
- Delete event: 16
- Member event: 3
- Issue comment event: 18
- Push event: 76
- Pull request review event: 62
- Pull request review comment event: 41
- Pull request event: 45
- Fork event: 7
Committers
Last synced: 6 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Lennart Reiher | l****r@i****e | 360 |
| Jean-Pierre Busch | j****h@i****e | 200 |
| Christian Geller | c****r@i****e | 15 |
| Benedikt Haas | b****s@i****e | 13 |
| Lukas Zanger | l****r@i****e | 12 |
| Raphael van Kempen | r****n@i****e | 8 |
| Fabian Thomsen | f****n@i****e | 7 |
| Till Beemelmanns | t****s@i****e | 5 |
| Amarin Klöker | a****r@i****e | 3 |
| nitheesh | s****h@g****m | 2 |
| yaymalaga | y****a@g****m | 2 |
| Guido Küppers | g****s@i****e | 1 |
| Lars Ippen | l****n@i****e | 1 |
| Lukas Ostendorf | l****f@i****e | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 4 months ago
All Time
- Total issues: 6
- Total pull requests: 13
- Average time to close issues: 4 months
- Average time to close pull requests: 8 days
- Total issue authors: 6
- Total pull request authors: 6
- Average comments per issue: 0.83
- Average comments per pull request: 0.31
- Merged pull requests: 9
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 5
- Pull requests: 13
- Average time to close issues: 4 days
- Average time to close pull requests: 8 days
- Issue authors: 5
- Pull request authors: 6
- Average comments per issue: 0.8
- Average comments per pull request: 0.31
- Merged pull requests: 9
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- bastilam (1)
- JensStaub (1)
- kyleoptimotive (1)
- Tezozomoc47 (1)
- blooop (1)
- snknitheesh (1)
- lreiher (1)
Pull Request Authors
- lreiher (16)
- jpbusch (10)
- robin-mueller (2)
- lukaszanger (2)
- bastilam (1)
- Estivio (1)
- snknitheesh (1)
- RaphvK (1)
- cgeller (1)
- akloeker (1)
- BenediktHaas96 (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
- Total downloads: unknown
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 16
github actions: ika-rwth-aachen/docker-ros
docker-ros automatically builds development and deployment Docker images for your ROS-based repositories.
- License: mit
-
Latest release: v1.8.0
published 7 months ago
Rankings
Dependencies
- convictional/trigger-workflow-and-wait v1.6.5 composite
- actions/download-artifact v3 composite
- actions/upload-artifact v3 composite
- actions/checkout v3 composite
- docker/login-action v2 composite
- docker/setup-buildx-action v2 composite
- docker/setup-qemu-action v2 composite
- gacts/github-slug v1 composite
- ros-industrial/industrial_ci master composite
- ${BASE_IMAGE} latest build
- dependencies-install latest build
- dev latest build