feat: add arg in compose file to select ros image - #264
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Docker-based development environment to support selecting an alternate ROS base image (e.g., for ARM64 hosts) by introducing a configurable ROS_IMAGE build arg and documenting how to override it in compose.yaml.
Changes:
- Add a
ROS_IMAGEDocker build argument and switch theFROMline to use it. - Add a commented example in
docker/compose.yamlshowing how to override the base image for ARM devices.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| docker/Dockerfile | Adds ROS_IMAGE build arg and uses it for the base image selection. |
| docker/compose.yaml | Adds a commented ARM override example for ROS_IMAGE in build args. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
I verified that removing the "ENV ..." line works as expected. The background from this comes from this link. By default, ARGs declared before the FROM command are not in scope after the FROM command. So the line "ENV ROS_DISTRO=${ROS_DISTRO}" was only working because ROS_DISTRO was already set by the base image. It was not getting pulled in from the "ARG ROS_DISTRO" line. That line was redundant, so I removed it. I verified that it still works by building it and making sure the expansions still resolved by checking to see if the plotjuggler apt package was installed. |
To use this Dockerfile on arm-based machines (e.g. RPi or Jetson Orin), we need to use a different base image. This PR adds a Dockerfile arg to select the ROS base image, and adds a comment in the compose.yaml file that users can uncomment when running on arm device.
By default, the Dockerfile will pull the amd64-based image.