-
Notifications
You must be signed in to change notification settings - Fork 0
Add Docker support and GitHub Container Registry CI workflow #3
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
Conversation
- Add Dockerfile with multi-stage build using Go 1.23 and scratch base - Add .dockerignore to optimize build context - Add docker-compose.yml for local development - Modify main.go to support --help flag for Docker usage - Update CI workflow to build and push Docker images to GHCR - Add dedicated Docker workflow with build tests and multi-platform support - Update README.md with comprehensive Docker usage examples and badges - Support for linux/amd64 and linux/arm64 platforms - Docker images tagged with version, latest, and edge variants - Includes build-time version injection and metadata labels
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
- Added comprehensive description to Docker image labels - Enhanced CI workflow with more detailed OCI image labels - Updated Dockerfile with better description matching CI workflow - Added version, revision, and creation timestamp metadata
- Fix Docker Build Test job by adding load:true to make image available to local daemon - Enhance Docker metadata and descriptions in docker.yml workflow - Update README.md with comprehensive Docker documentation - Add Docker image size badge to README.md
- Add Docker package ecosystem to track base image updates - Add Docker Compose package ecosystem to track service dependencies - Maintain same weekly schedule and labeling conventions
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 adds comprehensive Docker support and integrates GitHub Container Registry CI workflows for building, tagging, and pushing Docker images, while also improving application usability through a new help flag.
- Updates Docker infrastructure with a multi-stage Dockerfile, .dockerignore, and docker-compose configuration.
- Enhances CI/CD by adding dedicated workflows for Docker testing, build, and push operations.
- Improves documentation in the README with detailed usage instructions and badge indicators.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| main.go | Adds a help flag to display usage and version information. |
| docker-compose.yml | Introduces multiple service definitions for local development and file processing. |
| README.md | Documents Docker image usage, available tags, and usage examples. |
| Dockerfile | Implements a multi-stage build including build metadata injection and a scratch runtime image. |
| .github/workflows/docker.yml | Provides CI workflow for testing, building, and pushing Docker images. |
| .github/workflows/ci.yml | Integrates Docker build & push steps within the CI pipeline. |
| .github/dependabot.yml | Adds update checks for Docker and Docker Compose. |
| .dockerignore | Optimizes the build context by excluding non-essential files. |
- Add appuser (UID 1000) in builder stage - Copy passwd file to scratch image - Use USER directive to run as non-root user - Fix docker-compose.yml to use YAML anchors properly - Add Dockerfile.dev for development with shell access - Addresses PR review comment about security
- Add grouping for Docker image updates - Add grouping for Docker Compose updates - Group minor and patch updates together - Update .gitignore to exclude copilot instructions
Add documentation addressing PR feedback: - Implementation of non-root Docker user - Explanation of security improvements - Notes on other PR comments
This comment was marked as outdated.
This comment was marked as outdated.
Merges Docker-related workflows into CI config for unified processing. Introduces Docker test job to validate image builds in pull requests. Replaces repetitive YAML configurations with environment variables. Simplifies test function parameters in Go tests for clarity. Addresses inefficiencies and reduces workflow duplication.
Simplifies coverage summary generation by removing redundant loop, and improves Docker build step with the inclusion of SBOM, provenance attestation, and security scanning features. Updates Docker summary with new features for enhanced transparency and readiness for vulnerability analysis.
Introduces concurrency control in CI for efficient workflow execution. Refines coverage reporting to aggregate by package instead of filename. Adds Docker documentation outlining usage, available tags, and development instructions. Updates Dockerfile references to the new documentation. Improves reliability and clarity of CI and Docker processes.
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 integrates Docker support and sets up CI workflows to build and publish Docker images to GitHub Container Registry.
- Introduces multi-stage Dockerfiles and
docker-compose.ymlfor local development. - Updates CI (
ci.yml) to cache modules, run Docker build/tests, and push images. - Expands documentation (
README.md,DOCKER.md) with Docker usage, badges, and Dependabot updates.
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| main_test.go | Renamed test field and added TestRunWithHelpFlags cases |
| main.go | Added help-flag handling in run() |
| docker-compose.yml | Configured services for local and dev scenarios |
| README.md | Added Docker badges and detailed usage sections |
| Dockerfile.dev | New development Dockerfile with shell access |
| Dockerfile | New production multi-stage Dockerfile |
| DOCKER.md | Dedicated Docker documentation |
| .github/workflows/ci.yml | Enhanced CI for Docker build/test and caching |
| .github/dependabot.yml | Added Docker and Docker Compose update checks |
| .dockerignore | Extended ignore patterns for container builds |
Comments suppressed due to low confidence (2)
main_test.go:18
- [nitpick] The field name
stris generic; consider reverting toinputor a more descriptive name to improve test readability.
str string
README.md:215
- [nitpick] The Docker size in README (~15–20MB) conflicts with DOCKER.md (<10MB). Please reconcile the actual image size or remove the approximation.
| **Size**: ~15-20MB compressed
Updates CI branches and adds support for Go 1.22.x Integrates CodeQL for security analysis via workflow call Adds a new workflow for dependency review, enhancing security Introduces release workflow for automated binary compression and GitHub release creation Refactors main program to separate usage logic These changes improve code security and workflow control. Fixes #123
4c7b5f7 to
2b819f6
Compare
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
Adds Docker support and CI workflows for building, testing, and publishing container images to GitHub Container Registry.
- Introduces multi-stage Dockerfiles (
Dockerfile&Dockerfile.dev) anddocker-compose.ymlfor local development and minimal runtime images - Enhances CI/CD (
.github/workflows/ci.yml) with Docker build/test jobs, retryable dependency downloads, caching, and metadata-driven image publishing - Updates
main.goandmain_test.goto support--help/--versionflags, and revises documentation (README.md,DOCKER.md) with Docker usage instructions
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| main.go | Added version/help flag handling and extracted usage printing logic |
| main_test.go | Renamed test fields, added tests for help/version flags |
| Dockerfile & Dockerfile.dev | Defined multi-stage builds with non-root user, metadata labels |
| docker-compose.yml | Local development services for parser and shell access |
| README.md & DOCKER.md | Documented Docker image usage, tags, compose, and registry details |
| .github/workflows/ci.yml | Extended CI with Docker build/test jobs, caching, retries, and summary |
| .github/dependabot.yml | Added Docker and Docker Compose update checks |
| .dockerignore | Excluded unnecessary files from Docker build context |
Comments suppressed due to low confidence (6)
main_test.go:18
- [nitpick] The field name
stris ambiguous compared to the function parameterinput; consider renaming it back toinputfor clarity and consistency.
str string
main.go:90
- Manual string concatenation in a loop can be less efficient; consider using
strings.Join(strs, sep)for better performance and readability.
func joinStrings(strs []string, sep string) string {
Dockerfile.dev:46
- The
go buildinvocation dropped the-ldflagsand-o articulate-parserflags, so the binary will be namedmainwithout embedded version info; restore those flags and output name.
./main.go
Dockerfile:43
- Similar to
Dockerfile.dev, this build command removed the-ldflagsand-o articulate-parseroptions, resulting in a misnamed binary and missing metadata; reintroduce those flags.
./main.go
main_test.go:246
- The new tests use
os,io,bytes, andstringsbut these packages aren’t imported at the top; add the missing imports to ensure the tests compile.
oldStdout := os.Stdout
DOCKER.md:25
- The example omits the required
<format>and<output>arguments; update it to...:latest <source> <format> <output>to matchprintUsageexpectations.
docker run --rm -v $(pwd):/data ghcr.io/kjanat/articulate-parser:latest /data/document.txt
|
This pull request introduces significant updates to the CI/CD pipeline, Docker integration, and repository configuration. Key changes include the addition of CI/CD Pipeline Enhancements:
Docker Integration:
Repository Configuration:
New Workflows:
|
Overview
This PR adds comprehensive Docker support and sets up CI workflows for building and pushing Docker images to the GitHub Container Registry (GHCR).
Changes Made
Docker Infrastructure
Dockerfile: Multi-stage build using golang:1.23-alpine for builder and scratch for runtime
.dockerignore: Optimizes build context by excluding unnecessary files
docker-compose.yml: Local development and testing setup
CI/CD Enhancements
.github/workflows/ci.yml): Added Docker build and push job.github/workflows/docker.yml): Separate workflow for Docker operationslatestand version-based tagsApplication Improvements
--helpflag support displaying:Documentation
Docker Usage
Pull and run from GHCR:
docker run --rm -v $(pwd):/data ghcr.io/kjanat/articulate-parser:latest /data/input.txtLocal development:
Testing
Security Considerations
This enhancement makes the articulate-parser easily deployable and integrates seamlessly with containerized workflows.