feat: --instance flag for parallel container instances (v0.6.8)#61
Merged
Conversation
Adds optional --instance NAME to run/exec/stop scripts, enabling multiple
parallel containers from the same repo without name collision.
Design:
- Default invocation unchanged: container = ${IMAGE_NAME}, project name
= ${DOCKER_HUB_USER}-${IMAGE_NAME}
- With --instance dev2: container = ${IMAGE_NAME}-dev2, project name
= ${DOCKER_HUB_USER}-${IMAGE_NAME}-dev2 → fully isolated network/volumes
- compose.yaml's container_name now uses ${IMAGE_NAME}${INSTANCE_SUFFIX:-}
so default keeps the clean name (preserves external `docker exec
${IMAGE_NAME}` patterns) and named instances get a -NAME suffix
- run.sh foreground devel refuses to start if default container already
running (caller must explicit ./stop.sh or use --instance)
- stop.sh gains --instance and --all flags. --all enumerates all matching
compose projects via docker ps label and downs each
213 tests total (was 201): 12 new unit tests for flag parsing, env passing,
help text, and collision refusal.
Note: existing 17 consumer repos need a one-line compose.yaml update to
use ${IMAGE_NAME}${INSTANCE_SUFFIX:-} before --instance works there.
Default behavior is fully backward-compatible until they upgrade.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This was referenced Apr 24, 2026
Merged
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
Adds optional
--instance NAMEtorun.sh/exec.sh/stop.shso you can run multiple containers from the same repo in parallel without name collision.Usage
Design
${IMAGE_NAME}, ci.sh and other tools that grepdocker exec ${IMAGE_NAME}continue to work--instance NAME— project name + container name get-NAMEsuffix, fully isolated docker compose project (own network, volumes)compose.yamlusescontainer_name: ${IMAGE_NAME}${INSTANCE_SUFFIX:-}(template'sinit.sh-generated example updated; existing 17 consumer repos need a one-line edit before--instanceworks there)./run.sh(foreground devel) refuses if a container with the default name is already running. Caller must explicitly./stop.shor use--instance NAMEstop.sh --all— enumerates all compose projects matching${DOCKER_HUB_USER}-${IMAGE_NAME}*via docker labels and downs eachTest plan
Note for consumer repos
Existing 17 repos must update
compose.yaml:Backward compatible — default behavior unchanged until they upgrade.
🤖 Generated with Claude Code