perf: skip image rebuild when image already exists (fast path for aidc up/claude) - #14
Open
ai-anant wants to merge 1 commit into
Open
perf: skip image rebuild when image already exists (fast path for aidc up/claude)#14ai-anant wants to merge 1 commit into
ai-anant wants to merge 1 commit into
Conversation
aidc up / aidc claude & friends always ran 'docker compose up -d --build', which re-evaluates (and can re-run) the full ~3GB image build on every start. Add a fast path: build only when the compose image is missing; otherwise start the container directly. aidc rebuild/rescan still force --build, and AIDC_NO_BUILD=1 opts out of builds entirely (fails fast if the image is missing). Refs cyfinoid#13
This was referenced Aug 2, 2026
Open
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.
Summary
Every
aidc up/aidc claude/aidc codexrandocker compose up -d --build, forcing Docker to re-evaluate — and on any cache miss, re-run — the full ~3 GB image build on every start. This is the "every aidc claude or aidc start results in a large ~4GB container" experience.This PR adds a fast path: the image is built only when it's missing; otherwise compose just starts the container.
Changes
lib/aidc.shaidc::image_exists— resolves the compose image name (docker compose config --images) and checks the local image store.aidc::compose_up— used bycmd_upandensure_container_running(the path all tool commands go through). Builds only when the image is missing.aidc rebuild/aidc rescanstill call compose directly with--build, so forced rebuilds keep working.AIDC_NO_BUILD=1(project.env or env) opts out of builds entirely:upstarts the existing container and fails fast if the image is missing.docs/install.md— documents the fast path andAIDC_NO_BUILD.Expected impact
aidc up/aidc claudeon the same project: near-instant (no build evaluation, no downloads).aidc destroy/ afteraidc rebuild: unchanged (full build).Test plan
bash -n lib/aidc.shshellcheck -x lib/aidc.sh— clean.github/scripts/bash-compat-check.sh— passes under bash 3.2 (macOS)tests/resolve-oauth-token.test.sh— 7/7 passaidc uptwice — second run skips the build (verified via compose output)Closes #13