-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Support Dockerfile #1124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Support Dockerfile #1124
Conversation
Signed-off-by: Hyungyu Kim <[email protected]>
… feature-docker-update
…le.sbc for improved package installation
Signed-off-by: Hyungyu Kim <[email protected]>
Signed-off-by: Hyungyu Kim <[email protected]>
Signed-off-by: Hyungyu Kim <[email protected]>
Summary of ChangesHello @GyuH13, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the Dockerization strategy for TurtleBot3 by introducing a structured and modular approach. It now provides dedicated Dockerfiles and Docker Compose configurations tailored for both ROS2 Humble and Jazzy distributions, as well as optimized setups for PC and Single Board Computer environments. This change aims to improve the flexibility, maintainability, and robustness of development and deployment workflows for TurtleBot3 users, ensuring that each platform and ROS version benefits from a purpose-built and efficient Docker image. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces standardized Docker support for TurtleBot3 across PC and single-board computer (SBC) configurations for both ROS2 Humble and Jazzy distributions. The changes replace a single monolithic Dockerfile with organized, distribution-specific Docker configurations.
Key Changes:
- Created separate Dockerfiles and docker-compose configurations for PC and SBC deployments across Humble and Jazzy distributions
- Standardized container configurations with consistent security and resource settings
- Removed the legacy root-level Dockerfile in favor of the organized structure
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| docker/jazzy/sbc/docker-compose.yml | New compose file for Jazzy SBC deployment with standardized container settings |
| docker/jazzy/sbc/Dockerfile.sbc | New Dockerfile for Jazzy SBC with LiDAR drivers and minimal dependencies |
| docker/jazzy/pc/docker-compose.yml | Updated compose file for Jazzy PC, standardizing settings and volume mounts |
| docker/jazzy/pc/Dockerfile.pc | New Dockerfile for Jazzy PC with desktop, navigation, and cartographer packages |
| docker/humble/sbc/docker-compose.yml | New compose file for Humble SBC deployment with standardized container settings |
| docker/humble/sbc/Dockerfile.sbc | New Dockerfile for Humble SBC with LiDAR drivers and minimal dependencies |
| docker/humble/pc/docker-compose.yml | New compose file for Humble PC deployment with standardized container settings |
| docker/humble/pc/Dockerfile.pc | New Dockerfile for Humble PC with desktop, navigation, and cartographer packages |
| Dockerfile | Removed legacy root-level Dockerfile replaced by organized structure |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
docker/jazzy/pc/Dockerfile.pc
Outdated
| echo "export TURTLEBOT3_MODEL= # burger, waffle, waffle_pi" >> ~/.bashrc && \ | ||
| echo "export LDS_MODEL= # LDS-01, LDS-02, LDS-03" >> ~/.bashrc |
Copilot
AI
Oct 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The environment variables TURTLEBOT3_MODEL and LDS_MODEL are exported with empty values. This requires users to manually edit ~/.bashrc after container startup. Consider either removing these exports or providing sensible defaults (e.g., 'burger' for TURTLEBOT3_MODEL and 'LDS-01' for LDS_MODEL) to improve the out-of-box experience.
| echo "export TURTLEBOT3_MODEL= # burger, waffle, waffle_pi" >> ~/.bashrc && \ | |
| echo "export LDS_MODEL= # LDS-01, LDS-02, LDS-03" >> ~/.bashrc | |
| echo "export TURTLEBOT3_MODEL=burger # burger, waffle, waffle_pi" >> ~/.bashrc && \ | |
| echo "export LDS_MODEL=LDS-01 # LDS-01, LDS-02, LDS-03" >> ~/.bashrc |
docker/humble/pc/Dockerfile.pc
Outdated
| echo "export TURTLEBOT3_MODEL= # burger, waffle, waffle_pi" >> ~/.bashrc && \ | ||
| echo "export LDS_MODEL= # LDS-01, LDS-02, LDS-03" >> ~/.bashrc |
Copilot
AI
Oct 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The environment variables TURTLEBOT3_MODEL and LDS_MODEL are exported with empty values. This requires users to manually edit ~/.bashrc after container startup. Consider either removing these exports or providing sensible defaults (e.g., 'burger' for TURTLEBOT3_MODEL and 'LDS-01' for LDS_MODEL) to improve the out-of-box experience.
| echo "export TURTLEBOT3_MODEL= # burger, waffle, waffle_pi" >> ~/.bashrc && \ | |
| echo "export LDS_MODEL= # LDS-01, LDS-02, LDS-03" >> ~/.bashrc | |
| echo "export TURTLEBOT3_MODEL=burger # burger, waffle, waffle_pi" >> ~/.bashrc && \ | |
| echo "export LDS_MODEL=LDS-01 # LDS-01, LDS-02, LDS-03" >> ~/.bashrc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request significantly improves the Docker setup by providing dedicated Dockerfiles and docker-compose files for both PC and SBC platforms across Humble and Jazzy ROS distributions. This modular approach is a great step towards better maintainability. The changes correctly leverage pre-built binaries for dependencies, which is more efficient than building from source. My review includes several suggestions to further enhance the setup, focusing on security by reducing container privileges, improving usability by setting default environment variables, and optimizing the Docker images for SBCs.
| - /tmp/.docker.xauth:/tmp/.docker.xauth:rw | ||
| - ./workspace:/workspace | ||
| - ../../../:/root/turtlebot3_ws/src/turtlebot3 | ||
| privileged: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using privileged: true gives the container full root access to the host machine, which poses a significant security risk. It's highly recommended to avoid this. Instead, consider granting only the necessary capabilities via cap_add and mapping specific devices (e.g., /dev/ttyUSB0) using the devices key. This follows the principle of least privilege.
| - /tmp/.docker.xauth:/tmp/.docker.xauth:rw | ||
| - ./workspace:/workspace | ||
| - ../../../:/root/turtlebot3_ws/src/turtlebot3 | ||
| privileged: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using privileged: true gives the container full root access to the host machine, which poses a significant security risk. It's highly recommended to avoid this. Instead, consider granting only the necessary capabilities via cap_add and mapping specific devices (e.g., /dev/ttyUSB0) using the devices key. This follows the principle of least privilege.
| - /tmp/.X11-unix:/tmp/.X11-unix:rw | ||
| - /tmp/.docker.xauth:/tmp/.docker.xauth:rw | ||
| - ./workspace:/workspace | ||
| - ../../../:/root/turtlebot3_ws/src/turtlebot3 | ||
| privileged: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using privileged: true gives the container full root access to the host machine, which poses a significant security risk. It's highly recommended to avoid this. Instead, consider granting only the necessary capabilities via cap_add and mapping specific devices (e.g., /dev/ttyUSB0) using the devices key. This follows the principle of least privilege.
| - /tmp/.docker.xauth:/tmp/.docker.xauth:rw | ||
| - ./workspace:/workspace | ||
| - ../../../:/root/turtlebot3_ws/src/turtlebot3 | ||
| privileged: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using privileged: true gives the container full root access to the host machine, which poses a significant security risk. It's highly recommended to avoid this. Instead, consider granting only the necessary capabilities via cap_add and mapping specific devices (e.g., /dev/ttyUSB0) using the devices key. This follows the principle of least privilege.
docker/humble/pc/Dockerfile.pc
Outdated
| echo "export TURTLEBOT3_MODEL= # burger, waffle, waffle_pi" >> ~/.bashrc && \ | ||
| echo "export LDS_MODEL= # LDS-01, LDS-02, LDS-03" >> ~/.bashrc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exporting TURTLEBOT3_MODEL and LDS_MODEL with empty values can lead to runtime errors if scripts expect them to be set. It's more robust and user-friendly to provide sensible defaults. Users can still override them if needed.
echo "export TURTLEBOT3_MODEL=burger # burger, waffle, waffle_pi" >> ~/.bashrc && \
echo "export LDS_MODEL=LDS-01 # LDS-01, LDS-02, LDS-03" >> ~/.bashrc
docker/humble/sbc/Dockerfile.sbc
Outdated
| RUN mkdir -p ${COLCON_WS}/src && \ | ||
| cd ${COLCON_WS}/src && \ | ||
| git clone -b humble https://github.com/ROBOTIS-GIT/turtlebot3.git | ||
|
|
||
| RUN cd ${COLCON_WS}/src/turtlebot3 && \ | ||
| rm -rf turtlebot3_cartographer turtlebot3_navigation2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two RUN instructions can be combined into a single layer. This is a Docker best practice that helps to reduce the final image size and the number of layers, which is especially beneficial for resource-constrained SBCs.
RUN mkdir -p ${COLCON_WS}/src && \
cd ${COLCON_WS}/src && \
git clone -b humble https://github.com/ROBOTIS-GIT/turtlebot3.git && \
cd turtlebot3 && \
rm -rf turtlebot3_cartographer turtlebot3_navigation2
docker/humble/sbc/Dockerfile.sbc
Outdated
| echo "export TURTLEBOT3_MODEL= # burger, waffle, waffle_pi" >> ~/.bashrc && \ | ||
| echo "export LDS_MODEL= # LDS-01, LDS-02, LDS-03" >> ~/.bashrc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exporting TURTLEBOT3_MODEL and LDS_MODEL with empty values can lead to runtime errors if scripts expect them to be set. It's more robust and user-friendly to provide sensible defaults. Users can still override them if needed.
echo "export TURTLEBOT3_MODEL=burger # burger, waffle, waffle_pi" >> ~/.bashrc && \
echo "export LDS_MODEL=LDS-01 # LDS-01, LDS-02, LDS-03" >> ~/.bashrc
docker/jazzy/pc/Dockerfile.pc
Outdated
| echo "export TURTLEBOT3_MODEL= # burger, waffle, waffle_pi" >> ~/.bashrc && \ | ||
| echo "export LDS_MODEL= # LDS-01, LDS-02, LDS-03" >> ~/.bashrc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exporting TURTLEBOT3_MODEL and LDS_MODEL with empty values can lead to runtime errors if scripts expect them to be set. It's more robust and user-friendly to provide sensible defaults. Users can still override them if needed.
echo "export TURTLEBOT3_MODEL=burger # burger, waffle, waffle_pi" >> ~/.bashrc && \
echo "export LDS_MODEL=LDS-01 # LDS-01, LDS-02, LDS-03" >> ~/.bashrc
docker/jazzy/sbc/Dockerfile.sbc
Outdated
| RUN mkdir -p ${COLCON_WS}/src && \ | ||
| cd ${COLCON_WS}/src && \ | ||
| git clone -b jazzy https://github.com/ROBOTIS-GIT/turtlebot3.git | ||
|
|
||
| RUN cd ${COLCON_WS}/src/turtlebot3 && \ | ||
| rm -rf turtlebot3_cartographer turtlebot3_navigation2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two RUN instructions can be combined into a single layer. This is a Docker best practice that helps to reduce the final image size and the number of layers, which is especially beneficial for resource-constrained SBCs.
RUN mkdir -p ${COLCON_WS}/src && \
cd ${COLCON_WS}/src && \
git clone -b jazzy https://github.com/ROBOTIS-GIT/turtlebot3.git && \
cd turtlebot3 && \
rm -rf turtlebot3_cartographer turtlebot3_navigation2
docker/jazzy/sbc/Dockerfile.sbc
Outdated
| echo "export TURTLEBOT3_MODEL= # burger, waffle, waffle_pi" >> ~/.bashrc && \ | ||
| echo "export LDS_MODEL= # LDS-01, LDS-02, LDS-03" >> ~/.bashrc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exporting TURTLEBOT3_MODEL and LDS_MODEL with empty values can lead to runtime errors if scripts expect them to be set. It's more robust and user-friendly to provide sensible defaults. Users can still override them if needed.
echo "export TURTLEBOT3_MODEL=burger # burger, waffle, waffle_pi" >> ~/.bashrc && \
echo "export LDS_MODEL=LDS-01 # LDS-01, LDS-02, LDS-03" >> ~/.bashrc
… packages and development tools
Signed-off-by: Hyungyu Kim <[email protected]>
Signed-off-by: Hyungyu Kim <[email protected]>
Signed-off-by: Hyungyu Kim <[email protected]>
Signed-off-by: Hyungyu Kim <[email protected]>
Signed-off-by: Hyungyu Kim <[email protected]>
sunghowoo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. With Docker in place, dependency problems should be much easier to manage now. Nice work
Signed-off-by: Hyungyu Kim <[email protected]>
CHANGED
Dockerfiles,docker-compose.yml, andcontainer.shfiles for Humble and Jazzy versions have been added.NOTE
In docker folder :