🐳 Containerize WayWise and upload to DockerHub via GitHub Actions#122
🐳 Containerize WayWise and upload to DockerHub via GitHub Actions#122Copilot wants to merge 11 commits into
Conversation
Co-authored-by: kallegrens <105279176+kallegrens@users.noreply.github.com>
- Create multi-stage Dockerfile for optimized C++ builds - Add .dockerignore for efficient Docker builds - Create GitHub Actions workflow for automated DockerHub pushes - Add comprehensive Docker documentation in README and DOCKER.md - Update .gitignore to exclude build artifacts Co-authored-by: kallegrens <105279176+kallegrens@users.noreply.github.com>
- Add libatomic1 for ISO22133 example - Add Qt widgets/printsupport libraries for map_local_twocars - Create docker-compose.yml for easy container management - Verify all three executables run successfully Co-authored-by: kallegrens <105279176+kallegrens@users.noreply.github.com>
- Add instructions for running map_local_twocars with display - Document both X11 forwarding and headless mode options - Complete security check with CodeQL (no issues found) Co-authored-by: kallegrens <105279176+kallegrens@users.noreply.github.com>
add ghcr as container repository in addition to DockerHub. remove references to PRECISE and Chaos Engineering from readme's. add install options into CMakeLists.txt (used for a cleaner Dockerfile)
as it is not allowed in gh actions
instead use manual workflow dispatch when a new image should be built and pushed
There was a problem hiding this comment.
This works for now, cleaner would be to separate building and pushing into two workflows rather than guarding with if-statements. Will maybe do in a separate PR later.
There was a problem hiding this comment.
Pull Request Overview
This PR implements Docker containerization for WayWise to enable rapid deployments and state resets for security chaos engineering experiments in the PRECISE project. The implementation provides a multi-stage Dockerfile, GitHub Actions automation for building and publishing images, and comprehensive documentation.
- Multi-stage Dockerfile optimized for C++ builds with Ubuntu 24.04 base
- Automated CI/CD pipeline for building and publishing to DockerHub and GitHub Container Registry
- Complete documentation including quick start guide and troubleshooting
Reviewed Changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
Dockerfile |
Multi-stage build with MAVSDK installation, build dependencies, and minimal runtime image |
.github/workflows/docker-ghcr-build-push.yaml |
GitHub Actions workflow for automated Docker image builds and publishing |
docker-compose.yaml |
Docker Compose configuration with service definitions for three example applications |
README.md |
Added Docker usage section with quick start guide and connection examples |
DOCKER.md |
Comprehensive 370-line Docker reference guide with detailed usage instructions |
examples/CMakeLists.txt |
Added install targets for the three example executables |
.dockerignore |
Build context optimization by excluding unnecessary files |
.gitignore |
Added exclusions for downloaded binaries |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| RUN printf '#!/bin/sh\nexec /usr/local/bin/RCCar_MAVLINK_autopilot >/dev/null 2>&1 || exit 1\n' \ | ||
| > /usr/local/bin/healthcheck && chmod +x /usr/local/bin/healthcheck | ||
|
|
||
| # RUN useradd -m -s /bin/bash waywise |
There was a problem hiding this comment.
Commented-out code should be removed. This line is redundant as the user is already created on line 110 with groupadd/useradd commands. Remove this commented line to keep the Dockerfile clean.
| RUN printf '#!/bin/sh\nexec /usr/local/bin/RCCar_MAVLINK_autopilot >/dev/null 2>&1 || exit 1\n' \ | ||
| > /usr/local/bin/healthcheck && chmod +x /usr/local/bin/healthcheck |
There was a problem hiding this comment.
The healthcheck script will always fail. The script attempts to execute the autopilot binary and redirects all output to /dev/null, expecting it to exit successfully. However, the autopilot is a long-running service that doesn't exit on its own. This will cause the healthcheck to always report unhealthy. Consider using a different health check mechanism, such as checking if the process is running with pgrep RCCar_MAVLINK_autopilot or testing the UDP port availability.
There was a problem hiding this comment.
Fixed the healthcheck to use pgrep -x RCCar_MAVLINK_autopilot instead of trying to execute the binary. This checks if the process is running rather than waiting for it to exit. Commit a0edf39.
- Use pgrep to check if process is running instead of executing the binary - Remove redundant commented-out useradd line (user already created on line 110) Co-authored-by: kallegrens <105279176+kallegrens@users.noreply.github.com>
|
I have a hard time seeing the value of containerizing only the examples. Instead, there is value in containerizing WayWise by installing it as a proper library that can be used in other projects (like RCCar, ControlTower) directly (similar to MAVSDK) without using WayWise as a submodule. We could add a CMakeLists.txt file in the WayWise root that supports selective builds with CMake options for front-end/back-end components. This would be very useful, for example, when performing chaos experiments on applications (such as Precise-Truck). |
Feature: Docker containerization for WayWise with automated builds and publishing to DockerHub and GitHub Container Registry.
WayWise requires manual local builds and has no containerization support, making it difficult to spin up clean, isolated instances quickly for experiments.
Fixes #121
This PR implements complete Docker containerization for WayWise:
Multi-stage Dockerfile
RCCar_MAVLINK_autopilot(default)RCCar_ISO22133_autopilotmap_local_twocarswaywisefor enhanced securitypgrepto verify the main process is runningGitHub Actions Workflow
Documentation
Key Features
No breaking changes. This adds new functionality without affecting existing usage.
To enable automated publishing, add these repository secrets:
DOCKERHUB_USERNAME: DockerHub username or organizationDOCKERHUB_TOKEN: DockerHub access tokenOriginal prompt
Fixes #121
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.