Skip to content

Conversation

@MadsJJ
Copy link
Member

@MadsJJ MadsJJ commented Nov 14, 2025

No issue created

Changes

  • Add Dockerfile, build and run scripts
  • Add devcontainer.json file for developement in vscode
  • Add bash script used in container startup
  • gitignore ros build files

…og to gitignore for ros2 building

(cherry picked from commit 8e12da2)
(cherry picked from commit 8f178c9)
(cherry picked from commit 7443658)
(cherry picked from commit e4d9c5e)
(cherry picked from commit 8232a57)
@MadsJJ MadsJJ self-assigned this Nov 14, 2025
@MadsJJ MadsJJ added the enhancement New feature or request label Nov 14, 2025
@codecov
Copy link

codecov bot commented Nov 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.81%. Comparing base (d97cb91) to head (e79a74a).
⚠️ Report is 12 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #29   +/-   ##
=======================================
  Coverage   57.81%   57.81%           
=======================================
  Files           5        5           
  Lines          64       64           
=======================================
  Hits           37       37           
  Misses         27       27           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

Copilot AI left a 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 adds comprehensive Docker support for the ROS 2 image segmentation project, enabling containerized development and deployment with both standard Docker and VS Code devcontainer workflows.

  • Adds Dockerfile based on ros:humble with all required ROS and Python dependencies
  • Provides build and run scripts for simplified Docker container management
  • Configures VS Code devcontainer for integrated development environment

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
docker/Dockerfile Multi-stage Docker image definition with ROS 2 Humble base, system dependencies, Python packages, and non-root user setup
docker/build.sh Build script with platform detection (arm64/amd64) and buildx integration for creating the Docker image
docker/run.sh Run script that launches the container with host networking, privilege mode, and workspace volume mounting
scripts/bashrc_extra.sh Bash startup script that sources ROS 2 underlay and workspace overlay when entering the container
.devcontainer/devcontainer.json VS Code devcontainer configuration with extension recommendations and container runtime arguments
.gitignore Excludes ROS 2 build artifacts (install/, build/, log/) from version control
.dockerignore Excludes build artifacts, VCS files, and development tools from Docker build context

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

# ----------------------------------------------------------------------------
# Copy Workspace Files
# ----------------------------------------------------------------------------
COPY . ${WORKSPACE}
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workspace is owned by root (COPY is executed as root user) but later switched to a non-root user. This will cause permission issues when the non-root user tries to write to the workspace. Consider changing ownership of the workspace after copying: RUN chown -R ${USER_ID}:${GROUP_ID} ${WORKSPACE}

Copilot uses AI. Check for mistakes.
Comment on lines 60 to 61
RUN groupadd --gid ${GROUP_ID} ${USERNAME} || true && \
useradd --uid ${USER_ID} --gid ${GROUP_ID} -m -s /bin/bash ${USERNAME} || true && \
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The groupadd and useradd commands use || true to suppress errors if the user/group already exists, but this silently ignores all errors including genuine failures. Consider using more specific error handling or checking if the user exists first.

Suggested change
RUN groupadd --gid ${GROUP_ID} ${USERNAME} || true && \
useradd --uid ${USER_ID} --gid ${GROUP_ID} -m -s /bin/bash ${USERNAME} || true && \
RUN if ! getent group ${USERNAME} >/dev/null; then groupadd --gid ${GROUP_ID} ${USERNAME}; fi && \
if ! id -u ${USERNAME} >/dev/null 2>&1; then useradd --uid ${USER_ID} --gid ${GROUP_ID} -m -s /bin/bash ${USERNAME}; fi && \

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ignoring this. removing "|| true" creates problems for mac users (and possibly windows), as it uses different ids automatically assigned.

MadsJJ and others added 3 commits November 28, 2025 16:17
- Reorder Dockerfile to create the non-root user before copying source code.
- Add `chown` to workspace files to ensure the non-root user has write access.
- Remove redundant `--user` flag in run.sh to rely on the image's configured user.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants