{"id":28247347,"url":"https://github.com/grassjelly/daisy","last_synced_at":"2025-06-15T05:31:23.216Z","repository":{"id":193695328,"uuid":"689324936","full_name":"grassjelly/daisy","owner":"grassjelly","description":" A tool to easily Dockerize ROS2 workspaces and packages.","archived":false,"fork":false,"pushed_at":"2025-05-03T16:53:33.000Z","size":201,"stargazers_count":18,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-19T10:09:03.306Z","etag":null,"topics":["docker","ros2"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/grassjelly.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-09-09T13:00:36.000Z","updated_at":"2025-05-03T16:53:36.000Z","dependencies_parsed_at":"2023-09-09T14:26:58.014Z","dependency_job_id":"a05f8d8c-ba2d-470c-9f7f-35a2368f2722","html_url":"https://github.com/grassjelly/daisy","commit_stats":null,"previous_names":["grassjelly/daisy"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/grassjelly/daisy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grassjelly%2Fdaisy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grassjelly%2Fdaisy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grassjelly%2Fdaisy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grassjelly%2Fdaisy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grassjelly","download_url":"https://codeload.github.com/grassjelly/daisy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grassjelly%2Fdaisy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259926807,"owners_count":22933128,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","ros2"],"created_at":"2025-05-19T10:09:02.828Z","updated_at":"2025-06-15T05:31:23.197Z","avatar_url":"https://github.com/grassjelly.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"## 🌼 daisy\n(docker lazy)\nA tool to easily Dockerize ROS2 workspaces and packages. \n\nIn a nutshell, daisy contains a built-in [`Dockerfile`](./Dockerfile) and [`docker-compose.yaml`](./docker-compose.yaml) files to quickly spin a Docker container for the ROS2 workspace you're working on. It's a thin layer to conveniently call [Docker Compose](https://docs.docker.com/compose/) commands with a few helper scripts.\n\nDaisy aims to make ROS2 development workspaces become more reproducible without the huge bulk of git commiting all the source codes found in the workspace using [vcstool](https://github.com/dirk-thomas/vcstool#export-set-of-repositories).\n\nIf you want to quickly test a ROS2 package without system installing ROS2, or simply want to test whether your package builds on another distro, this tool is for you.\n\nA huge thanks to Sebastian Castro for this [blog post](https://roboticseabass.com/2023/07/09/updated-guide-docker-and-ros2/) and [Allison Thackston's Docker files](https://github.com/athackst/dockerfiles) which was used as a main reference in building this tool.\n\n| COMMAND           | ARGUMENTS                    | DESCRIPTION                                             |\n|-------------------|------------------------------|---------------------------------------------------------|\n| `daisy-build`     |-h                            | Build the workspace's Docker image.                     |\n| `daisy-compose`   |\u003cdocker_compose_args\u003e         | Similar to docker-compose. But can be run anywhere.     |\n| `daisy-shell`     |\u003cbash_commands\u003e               | Run bash commands from host or log-in inside container. |\n| `daisy-gitignore` |                              | Add _build_ _install_ _log_ to .gitignore of workspace. |\n| `daisy-template`  |src/my_package                | Add docker template to ROS2 package.                    |\n| `daisy-export`    |                              | Record all local repositories found in src.             |\n| `daisy-tmux`      |\u003ctmux_profile\u003e                | Record all local repositories found in src.             |\n\n### 1. Installation\n\n#### 1.1 Install Docker\n```\ncurl https://get.docker.com | sh \u0026\u0026 sudo systemctl --now enable docker\n```\nPost Docker Installation:\n```\nsudo usermod -aG docker $USER \u0026\u0026 newgrp docker\n```\nIf you're running with a Nvidia GPU, install [Nvidia Runtime](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html#installing-with-apt) and [reconfigure](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/1.12.1/user-guide.html#daemon-configuration-file) the deafult runtime.\n\n#### 1.2 Download daisy\nClone daisy into your ROS2 workspace (eg. $HOME/my_ros2_ws):\n```\ncd $HOME/my_ros2_ws\ngit clone https://github.com/grassjelly/daisy.git\n```\nTo use daisy, source the setup.bash file:\n```\ncd $HOME/my_ros2_ws\nsource daisy/setup.bash\n```\n- Once sourced, you can use daisy in any directory.\n\n#### 1.3 Configure the .env file:\n\n- **BASE_IMAGE** - set to `default` for barebones, `nvidia` for Nvidia based image, and `custom` if you're using a custom base image on CUSTOM_BASE.\n- **ROS_DOMAIN_ID** - ROS2 Domain ID. Defaults is `0`.\n- **USE_ROS_DISTRO** - ROS2 Distro to be used. Defaults is `humble`.\n- **USERNAME** - Ubuntu username. Defaults is `daisy`.\n- **CUSTOM_BASE** - Custom base Docker image to be used for eg. `nvcr.io/nvidia/tritonserver:24.08-py3`. Set to `null` if unused.\n\n#### 1.4 Build the Docker image:\n```\ndaisy-build \u003cdistro\u003e\n```\n- **distro** can be `foxy`, `galactic`, `humble`, or `iron`\n\n`daisy-build` will automatically find the dependencies of all the the ROS2 packages inside `src` directory of your workspace. **Take note that running this will stop all daisy spawned containers.**\n\nYou'll only need to run this command once or when you have made changes on on the dependencies (package.xml). You can modify the Dockerfile as you wish to add custom installation commands just remember to run `daisy-build` again when you're done. You can use the `--skip-import` flag to skip VCS import on re-builds.\n\nTake note that this does not build your ROS2 workspace. You'll have to build it explicitly by running:\n```\ndaisy-compose up colcon-build\n```\n### 2. Usage\n#### 2.1 Running bash commands relative to the docker-compose.yaml.\nUsing `daisy-compose`, you can run docker compose commands that are relative to the docker-compose.yaml file. This means you can run `docker compose` commands without being on the same directory as the compose file. For instance:\n```\ndaisy-compose up my_service\n```\nis similar to:\n```\ncd /home/my_ros2_ws/daisy #docker-compose.yaml directory\ndocker compose up my_service\n```\n\n#### 2.2 Debugging tool\nYou can use `daisy-shell`, to spawn a container and run bash commands inside the container from the host. For example:\n```\ndaisy-shell ros2 topic list\n```\nThis will return all the topics available within the network.\n\nIf no bash command is provided, it will log-in the debug container and use it like a normal shell.\n\n### 3. Dockerizing ROS2 workspaces and ROS2 packages\n\n#### 3.1 Dockerizing ROS2 workspaces (with src in git)\nIf you're Dockerizing your ROS2 workspace and pushing it in a git repository with the source codes in src,  use `daisy-gitignore` to add a .gitignore file in your ROS2 workspace to prevent commiting _build_ _install_ and _log_ directories.\n\nRun:\n```\ndaisy-gitignore\n```\n\n#### 3.2 Dockerizing ROS2 workspaces (without src in git)\nThis is a wrapper to [vcs-tool](https://github.com/dirk-thomas/vcstool#export-set-of-repositories) `export` command. If you're Dockerizing your ROS2 workspace and pushing it in a git repository without the source codes in src, use `daisy-export` to record all the local repositories found in your src directory. `daisy-build` will automatically download all the repositories if an install.repos is found on the workspace.\n\nRun:\n```\ndaisy-export\n```\n\nThis also auto-generates a quickstart guide (README.md) of the workspace.\n\n#### 3.3 Dockerizing ROS2 Packages\n`daisy-template` auto-generates a docker directory that contains all the files to create a Docker image and compose services.\n\n```\ndaisy-template src/\u003cmy_package\u003e\n```\n- `my_package` is the ROS2 package where you want to deploy the Docker template.\n\nTo test:\n```\ncd $HOME/my_ros2_ws/src/my_package/docker\ndocker compose build\n```\n\nOnce done, you can check if it works by running the `test` service to build the workspace:\n```\ndocker compose up test\n```\n\nYou can check out this comprehensive [tutorial](https://roboticseabass.com/2023/07/09/updated-guide-docker-and-ros2/) to learn more about ROS2-Docker workflows.\n\n#### 3.4 Running multiple screens and services.\n\n`daisy-tmux` is wrapper for [Tmuxinator](https://github.com/tmuxinator/tmuxinator) to spawn multiple screens and services.\n\n##### 3.4.1 Open multiple screens\n\n```\ndaisy-tmux \u003cnumber_of_screens\u003e\n```\n\n##### 3.4.2 Using profiles\n\nCreate a profile in daisy/tmux/my_profile.yaml by defining the docker services you want to run per pane. You can use `template.yaml` as a starting point.\n```\ndaisy-tmux my_profile\n```\n\n- daisy-tmux has an autocomplete feature that suggests all the created profiles in daisy/tmux by simply pressing tab after `daisy-tmux` command.\n\n##### 3.4.3 Exiting\nOn one of the panes, run:\n```\ndaisy-tmux -1\n```\n\n### 3. Miscellaneous\n\n#### 3.1 VNC Server and Web Client\n\nThere's a built-in KasmVNC server and Web Based client available in the daisy/daisy-compose.yaml. Simply run:\n\n```\ndaisy-compose up webtop\n```\n\nOn services that need a screen, `export DISPLAY:=200` to pipe the display to the VNC server.\n```\nexport DISPLAY:=200; daisy-compose up rviz\n```\n\nNow, you can view your applications in http://localhost:3000. This has also been tested on a remote setup on a GCP instance with [Tailscale](https://tailscale.com) for secured remote access. The Docker image has been configured to use [VirtualGL](https://virtualgl.org) for 3D acceleration (Nvidia GPUs) while using the VNC server for screen display.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrassjelly%2Fdaisy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrassjelly%2Fdaisy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrassjelly%2Fdaisy/lists"}