feat(docker): slim/full image variants + cached deps layer + [full] extra rename#138
Merged
feat(docker): slim/full image variants + cached deps layer + [full] extra rename#138
Conversation
…d GHA cache Dockerfile previously installed cocoindex-code, cocoindex, torch, sentence-transformers, and all transitive deps in one RUN. Any change to the source tree (via COPY . /ccc-src) invalidated that single layer, forcing a full re-install — ~1 GB of wheels for torch + friends — on every release. Under QEMU for the arm64 cross-build this was slow enough to be painful. Split into two stages: - `deps`: install cocoindex + cocoindex-code[default] from PyPI. Cache key is just the RUN command string, so this layer is reused across releases until we bump the pins. - `builder`: overlay the release version via `CCC_INSTALL_SPEC=/ccc-src[default]` with `--no-deps --force-reinstall` — only the cocoindex-code package is touched; the heavy deps layer stays untouched. Also add BuildKit layer cache (`type=gha`) to the publish-docker job so the deps layer persists across workflow runs, not just within a single build.
…ull] extra
Build two Docker image variants per release:
- slim (:latest, default) — ~450 MB. LiteLLM-only. cocoindex + cocoindex-code
without sentence-transformers. Targets cloud-backed embeddings.
- full (:full) — ~5 GB. Bundles sentence-transformers + torch +
a pre-baked default model. Targets offline-ready local embeddings.
Dockerfile gains a CCC_VARIANT build arg that gates stage 1's
sentence-transformers install and stage 3's model bake. Release workflow
matrices on {slim, full}; each variant has its own GHA cache scope so
layer reuse works across releases without the variants evicting each
other.
Also rename the PyPI `[default]` umbrella extra to `[full]` so pip and
Docker names match. `[embeddings-local]` remains the canonical primary
extra (the one that specifically pulls in sentence-transformers); `[full]`
is its umbrella alias that may bundle additional optional niceties later.
CLI hints that point at missing sentence-transformers continue to name
`[embeddings-local]` directly — the most specific pointer for that case.
README documents both image variants with a comparison table and narrows
the Mac-on-Docker MPS note to only :full users (slim + LiteLLM is
unaffected).
This was referenced Apr 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #135, #136, #137. Restructures the Docker image for fast incremental builds and publishes two variants per release.
Summary
Dockerfile — layer split for cache reuse across releases:
deps): installs only the heavy, slow-changing base deps per variant. Nococoindexorcocoindex-codehere — they bump too often. Cache key is the RUN command string, so this layer reuses across releases until we bump it manually.builder): installscocoindex+cocoindex-codeper release. Fast because transitive deps are already in place.Two image variants published per release:
cocoindex/cocoindex-code:latest(slim, default)cocoindex/cocoindex-code:fullRelease workflow matrices on
{slim, full}; each variant has its own GHA BuildKit cache scope so they don't evict each other's layers.:slim/:fulltag pair also published to GHCR.Packaging rename:
cocoindex-code[default]→cocoindex-code[full]to match the Docker variant name.[embeddings-local]remains the canonical primary extra;[full]is the umbrella alias that may bundle more optional niceties over time. CLI hints that point at missingsentence-transformerscontinue to reference[embeddings-local](the specific pointer).README: new "Choosing an image" table documents both variants. Mac-on-Docker MPS note narrowed to the
:fullcase only — slim + LiteLLM users are unaffected because inference happens on the provider's side.Test plan
docker buildfor both variants succeeds (verified: slim ≈ 431 MB, full ≈ 5.38 GB).workflow_dispatchwithtest_docker=truewill push:test(slim) and:test-fullto both registries; once confirmed, the following real release should show dramatically shorter per-release build time (base deps layer cached).🤖 Generated with Claude Code