Skip to content

feat: add Dockerfile and GHCR publish workflow#343

Open
bburda wants to merge 6 commits intomainfrom
feature/gateway-docker-image
Open

feat: add Dockerfile and GHCR publish workflow#343
bburda wants to merge 6 commits intomainfrom
feature/gateway-docker-image

Conversation

@bburda
Copy link
Copy Markdown
Collaborator

@bburda bburda commented Apr 2, 2026

Pull Request

Summary

Add multi-stage Dockerfile and GitHub Actions workflow to publish gateway Docker images to GHCR. Supports all 3 distros via ROS_DISTRO build arg.

Images published on push to main:

  • ghcr.io/selfpatch/ros2_medkit-jazzy:latest
  • ghcr.io/selfpatch/ros2_medkit-humble:latest
  • ghcr.io/selfpatch/ros2_medkit-rolling:latest

All open-core packages and plugins included. External plugins mountable at /opt/ros2_medkit/plugins/, default config overridable via volume mount at /etc/ros2_medkit/params.yaml.


Issue


Type

  • Bug fix
  • New feature or tests
  • Breaking change
  • Documentation only

Testing

  • Built image locally with docker build -t ros2_medkit:test .
  • Verified gateway starts and responds on /api/v1/health and /api/v1/version-info
  • Verified CORS, apps discovery, and fault management endpoints respond correctly

Checklist

  • Breaking changes are clearly described (and announced in docs / changelog if needed)
  • Tests were added or updated if needed
  • Docs were updated if behavior or public API changed

Copilot AI review requested due to automatic review settings April 2, 2026 17:23
@bburda bburda self-assigned this Apr 2, 2026
Copy link
Copy Markdown
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

Adds a production-oriented container build + publish path for ros2_medkit by introducing a multi-stage Docker image (parameterized by ROS_DISTRO) and a GitHub Actions workflow that publishes per-distro images to GHCR on main.

Changes:

  • Add a top-level multi-stage Dockerfile that builds the full workspace and ships a slim runtime image with an entrypoint to start gateway_node.
  • Add Docker runtime defaults (docker/gateway_docker_params.yaml) and an entrypoint script (docker/entrypoint.sh) for container startup/config override.
  • Add a docker-publish.yml workflow to build and push jazzy/humble/rolling images to GHCR, plus a .dockerignore for smaller contexts.

Reviewed changes

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

Show a summary per file
File Description
Dockerfile Multi-stage build and runtime image definition for the gateway + open-core packages/plugins.
docker/gateway_docker_params.yaml Default ROS parameters for running the gateway in Docker (host/port/CORS/refresh).
docker/entrypoint.sh Container entrypoint that sources ROS + workspace and runs gateway_node.
.github/workflows/docker-publish.yml GH Actions workflow to build/push GHCR images for each ROS distro.
.dockerignore Reduces Docker build context size by ignoring build artifacts, docs build output, etc.

@bburda bburda marked this pull request as draft April 2, 2026 17:35
@bburda bburda requested a review from Copilot April 2, 2026 18:12
@bburda bburda marked this pull request as ready for review April 2, 2026 18:12
Copy link
Copy Markdown
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

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

Copy link
Copy Markdown
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

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

Copy link
Copy Markdown
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

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

mfaferek93
mfaferek93 previously approved these changes Apr 3, 2026
Copy link
Copy Markdown
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

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

@bburda bburda force-pushed the feature/gateway-docker-image branch from 33c8a5f to 7a94502 Compare April 3, 2026 14:28
bburda added 6 commits April 4, 2026 11:25
Multi-stage Docker build (builder + runtime) with ROS_DISTRO build arg
for multi-distro support. Includes all open-core packages and plugins.

Workflow publishes 3 images on push to main:
- ghcr.io/selfpatch/ros2_medkit-jazzy:latest
- ghcr.io/selfpatch/ros2_medkit-humble:latest
- ghcr.io/selfpatch/ros2_medkit-rolling:latest

Default config at /etc/ros2_medkit/params.yaml (overridable via volume
mount). External plugins can be mounted at /opt/ros2_medkit/plugins/.

Closes #342
Update installation.rst Docker section to reference the published
GHCR images instead of pointing to selfpatch_demos only.

Rewrite tutorials/docker.rst with current image names, external
plugin mounting, Docker Compose example with web UI, and building
from source with ROS_DISTRO build arg.
- cpp-httplib: detect system package version, build v0.14.3 from source
  when system package is missing or too old (humble/Ubuntu 22.04)
- Add libcpp-httplib-dev and rosbag2_storage_mcap to rosdep skip-keys
  (installed separately or not available on all distros)
- Fix hardcoded jazzy in source command - use ROS_DISTRO env var
- Runtime stage: use minimal runtime libs instead of -dev packages
- Add curl for healthcheck support

Tested locally: jazzy and humble images build and pass health check.
- Add non-root medkit user in runtime stage for production safety
- Remove CORS wildcard default - disabled by default, opt-in via config
- Fix entrypoint --ros-args duplication - CMD now includes --ros-args,
  entrypoint passes args directly without injecting --ros-args
- Fix apt-cache show running without apt-get update (stale cache)
- Use repository_owner in workflow instead of hardcoded selfpatch
- Fix version-info example in docs to use placeholder
- Clarify plugin mount comment about explicit path configuration
Move COLCON_WS from /root/ws to /home/medkit/ws in the runtime stage
so the medkit user can access the installed workspace. Use COLCON_WS
env var in entrypoint instead of hardcoded /root path. Fix docs to
reflect CORS being disabled by default.
Add ros2_medkit_gateway.ros__parameters wrapper to the CORS YAML
snippet so users who copy-paste it get a working configuration.
@bburda bburda force-pushed the feature/gateway-docker-image branch from 7a94502 to ada6f5b Compare April 4, 2026 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Dockerfile and GHCR publish workflow for gateway

3 participants