Skip to content

fix: compose commands producing "docker docker compose" (#233)#234

Merged
joshrotenberg merged 3 commits intomainfrom
fix/compose-double-docker-233
Jan 16, 2026
Merged

fix: compose commands producing "docker docker compose" (#233)#234
joshrotenberg merged 3 commits intomainfrom
fix/compose-double-docker-233

Conversation

@joshrotenberg
Copy link
Copy Markdown
Owner

Summary

  • Fixes the "docker docker compose" bug where compose commands would fail with exit code 125
  • Adds regression tests to prevent this from recurring
  • Expands CI check to catch this antipattern

Root Cause

In src/command.rs, the execute_command helper was passing "docker" as the command name for compose commands:

// Before (buggy):
executor.execute_command("docker", command_args).await

But CommandExecutor::execute_command inserts the command name at position 0 of the args, then runs the command using docker as the runtime binary. This resulted in:

docker docker compose --file /path/to/compose.yaml ps php

Fix

Pass "compose" as the command name and skip the redundant "compose" prefix from args:

// After (fixed):
let remaining_args = command_args.into_iter().skip(1).collect();
executor.execute_command("compose", remaining_args).await

Changes

  1. src/command.rs:141-144 - Fix the compose command path to pass correct args
  2. src/command/compose/ps.rs - Add test_compose_args_no_docker_prefix regression test
  3. src/command.rs - Add test_compose_command_args_structure regression test
  4. .github/workflows/ci.yml - Expand antipattern check to include src/command.rs

Test plan

  • All 719 unit tests pass
  • All 377 doc tests pass
  • New regression tests verify compose args don't contain "docker"
  • CI antipattern check passes on fixed code

Fixes #233

joshrotenberg and others added 3 commits January 15, 2026 16:52
The execute_command helper was passing "docker" as the command name for
compose commands, but CommandExecutor also prepends the command name to
args before running. This resulted in "docker docker compose ..." instead
of "docker compose ...".

Fix: Pass "compose" as the command name and skip the redundant "compose"
prefix from args.

Changes:
- Fix execute_command to pass "compose" as command name for compose commands
- Add regression tests in ps.rs and command.rs
- Expand CI antipattern check to include src/command.rs

Fixes #233

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@joshrotenberg joshrotenberg merged commit 2997a8f into main Jan 16, 2026
11 checks passed
@joshrotenberg joshrotenberg deleted the fix/compose-double-docker-233 branch January 16, 2026 01:13
@github-actions github-actions Bot mentioned this pull request Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ComposePsCommand failing

1 participant