Skip to content

Add Docker workflow for reproducible / containerized builds (publish to GHCR on main) #9

Description

@rmems

Summary

Add a Docker workflow (.github/workflows/docker-build.yml or equivalent) for building (and optionally publishing) a container image for reproducible builds and verification. Use a simple multi-stage Dockerfile based on official Rust + cargo images (no CUDA needed for this zero-dep pure CPU crate).

Motivation

  • Reproducible environment for cargo build/test/clippy independent of host OS (catches subtle env issues early).
  • Potential for GHCR images (e.g. ghcr.io/limen-neural/engram-parser:main) that downstream consumers or examples can use easily.
  • Consistency with rmems/corinth-canal (which has .github/workflows/docker-build.yml + open Azure docs: standalone public docs pass for v0.3.0 (RM-1952) #109 for the full CI story).
  • Follows the pattern of other Limen-Neural Rust libs for DX and onboarding.

The current CI (.github/workflows/ci.yml) is ubuntu-only in GH Actions. Docker gives containerized verification on every PR/push, with publish only on main (mirroring corinth's split build vs. publish jobs).

Scope

  • New Dockerfile (multi-stage: builder with rust + cargo, final minimal image or just for CI verification).
  • New workflow in .github/workflows/ (e.g. docker-build.yml):
    • Build on PRs and pushes (push: false for verification; use gha cache).
    • On push to main: login to ghcr.io + build + push with tags for sha + "main".
    • Build args for RUST_VERSION=stable (keep simple; no CUDAHOSTCXX etc.).
    • Concurrency group, permissions (read for build, packages:write for publish).
    • Fork guard if needed (standard runners, so lighter than corinth's self-hosted GPU case).
  • Use docker/build-push-action with buildx + gha cache (like corinth).
  • Tag logic adapted from corinth (sha always; main on push; pr-### on PRs for verification).

Non-CUDA, CPU-only: just cargo check --all-features or full test inside the image for verification step (optional, since GH already does it; the value is the reproducible image itself).

Non-goals

  • Complex multi-arch (arm64 etc.) unless easy win; start linux/amd64.
  • Using the image for GPU/CUDA (n/a).
  • Replacing the existing GH Actions ci.yml (Docker runs alongside for verification/publish).
  • Full app runtime image (this is a library; image is for build env or simple tool usage).
  • Self-hosted runners (use standard ubuntu-latest or Docker-in-Docker capable runners).

Acceptance Criteria

  • Dockerfile exists at root (or in a docker/ dir) with clear comments.
  • .github/workflows/docker-build.yml (or similar name) exists.
  • Workflow triggers on PRs and pushes to main.
  • Verification job builds the image on PRs/pushes (push: false) and succeeds.
  • Publish job only on push to main, logs in to ghcr.io using GITHUB_TOKEN, pushes with proper tags.
  • Caching via gha is configured (cache-from / cache-to).
  • README.md updated with Docker section (build command, example usage of the image if published, link to workflow).
  • Cross-link to the sibling Azure Pipelines issue (and existing ci.yml).
  • Workflow respects security (minimal permissions, fork guard if applicable).

Open Questions

  • Should we publish a "latest" tag or only sha + main?
  • Do we want an example or tool in the image (e.g. the gguf_smoke or a simple manifest tool) or keep it build-env only?
  • Multi-arch (linux/arm64) via buildx? (increases build time; can be follow-up).
  • Should the Docker job also run cargo test --all-features inside the container for extra verification, or just build?

Related


Adapted from corinth-canal Docker patterns for a simple pure-Rust lib (no CUDA).

Activity

  1. self-assigned this
    on Jul 2, 2026
  2. rmems commented on Jul 2, 2026

    @rmems
    OwnerAuthor

    Sibling issue (Azure Pipelines): #8

    Both follow the pattern from corinth-canal #109 (Azure) and its docker-build.yml for org consistency. See plan for details. Cross-platform + containerized verification for this pure-Rust zero-dep crate.

  3. rmems commented on Jul 3, 2026

    @rmems
    OwnerAuthor

    New CI/CD improvement issues created (better GH + security + releases + MSRV + dependabot + layout hygiene, per approved plan). Cross-links:

    See #8 (Azure) too. All build on the existing CI baseline + corinth/neuromod patterns for Limen-Neural DX (LIM-9). Grok Build assisted drafting. (Separate ymls preferred where it makes sense.)

  4. rmems commented on Jul 5, 2026

    @rmems
    OwnerAuthor

    Combined with #11 into single PR: #17

    Branch: feat/harden-ci-gh-actions

    Docker files + workflow added. Build verified. See PR for details. (Using user's Docker CLI for local as required.)

  5. added a commit that references this issue on Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions