Skip to content

Add -i and -t to run and exec - #9229

Merged
glours merged 1 commit into
docker:v2from
ulyssessouza:add-ti-run-exec
Mar 4, 2022
Merged

glours merged 1 commit into
docker:v2from
ulyssessouza:add-ti-run-exec

Conversation

@ulyssessouza

Copy link
Copy Markdown
Contributor

What I did
Add -i and -t to commands run and exec as hidden options, since they are not used.
This is just to avoid breakage on scripts or old usages from users.

Related issue
Resolves #9207

Signed-off-by: Ulysses Souza <[email protected]>

@glours glours left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@glours
glours merged commit c64b044 into docker:v2 Mar 4, 2022
Comment thread cmd/compose/exec.go
runCmd.Flags().BoolVarP(&opts.noTty, "no-TTY", "T", false, "Disable pseudo-TTY allocation. By default `docker compose exec` allocates a TTY.")
runCmd.Flags().StringVarP(&opts.workingDir, "workdir", "w", "", "Path to workdir directory for this command.")

runCmd.Flags().BoolP("interactive", "i", true, "Keep STDIN open even if not attached. DEPRECATED")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those are not DEPRECATED, just on by default
(also, if we want to deprecate flag, should use flags.MarkDeprecated)

yahyatoubali added a commit to NadiCorporation/Crashwise that referenced this pull request May 10, 2026
Build error on Yahya's machine after image build success:

    ERROR: for crashwise-temporal  'ContainerConfig'
    KeyError: 'ContainerConfig'
    File "/usr/lib/python3/dist-packages/compose/service.py", line 1579
    in get_container_data_volumes
        container.image_config['ContainerConfig'].get('Volumes') or {}

Root cause: ``docker-compose`` v1.29.2 (the last release of the legacy
Python implementation) reads a ``ContainerConfig`` field that modern
Docker Engines (24.x+) no longer return.  Tracking issue:
docker/compose#9229.  This is NOT a CrashWise bug — it is a hard
incompatibility between two third-party tools that ship together on
older Ubuntu / system-pip installs.

Yahya's machine has only the legacy v1 standalone on PATH.  The fix
is to migrate to the modern v2 plugin (``docker compose ...`` —
note the SPACE).

Changes:

1. ``check_runtime_docker_compose`` (crashwise/core/sentinel.py):
   - Probe the v2 plugin (``docker compose version``) FIRST.
   - When only legacy v1 is present, return CheckStatus.FAIL — NOT a
     soft warning — because it WILL break the user's first
     ``docker compose up -d`` the moment they rebuild an image.
   - Per-distro migration commands:
       Arch:    sudo pacman -Syu docker docker-compose docker-buildx
       Ubuntu:  sudo apt-get remove docker-compose &&
                sudo apt-get install docker-compose-plugin
       Fedora:  sudo dnf install docker-compose-plugin &&
                sudo dnf remove python3-docker-compose
   - Permissive on unrecognised standalone versions (don't penalise
     a self-built v2-compatible binary).

2. ``docs/INSTALL.md``:
   - New prominent warning at the top of the "Running your first
     campaign" section.
   - New troubleshooting entry "Legacy docker-compose v1 — KeyError:
     'ContainerConfig'" with the full migration recipe and links to
     docker/compose#9229.

3. ``README.md``:
   - Quick Start "One-Command Stack" section now opens with a docker
     compose v2 warning that links to the INSTALL guide.

4. ``tests/unit/test_sentinel.py``:
   - Updated ``test_check_runtime_docker_compose_*`` suite:
       - Renamed ``ok_standalone`` → ``legacy_v1_is_fail`` (asserts the
         new policy).
       - Added ``ok_v2_plugin`` test for the happy path.
       - Added ``unfamiliar_version_is_ok`` test for forward-compat.
   - All 63 sentinel tests pass; 99/99 on touched surface.
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.

Proposal: add -i and -t flags on docker compose run and exec

3 participants