Skip to content

Conversation

@tonyo
Copy link
Contributor

@tonyo tonyo commented Oct 23, 2025

What I did

Replaced backticks with single quotes in the help output of docker compose exec for the --no-TTY option.

Currently the output of docker compose exec --help looks like this:

✘ $ docker compose exec --help
Usage:  docker compose exec [OPTIONS] SERVICE COMMAND [ARGS...]

Execute a command in a running container

Options:
  -d, --detach                       Detached mode: Run command in the background
      --dry-run                      Execute command in dry run mode
  -e, --env stringArray              Set environment variables
      --index int                    Index of the container if service has multiple replicas
  -T, --no-TTY docker compose exec   Disable pseudo-TTY allocation. By default docker compose exec allocates a TTY.
      --privileged                   Give extended privileges to the process
  -u, --user string                  Run the command as this user
  -w, --workdir string               Path to workdir directory for this command

Note the -T line:

  -T, --no-TTY docker compose exec   Disable pseudo-TTY allocation. By default docker compose exec allocates a TTY.

That "docker compose exec" part after --no-TTY is most likely unintentional; it's there because Cobra (or more specifically, pflag) found the backticks and extracted the wrapped value via UnquoteUsage function.
This is a not-so-well documented behavior, see e.g. this and this.

After the change the output looks as expected:

✓ $ ./bin/build/docker-compose exec --help
Usage:  docker compose exec [OPTIONS] SERVICE COMMAND [ARGS...]

Execute a command in a running container

Options:
  -d, --detach            Detached mode: Run command in the background
      --dry-run           Execute command in dry run mode
  -e, --env stringArray   Set environment variables
      --index int         Index of the container if service has multiple replicas
  -T, --no-tty            Disable pseudo-TTY allocation. By default 'docker compose exec' allocates a TTY.
      --privileged        Give extended privileges to the process
  -u, --user string       Run the command as this user
  -w, --workdir string    Path to workdir directory for this command

Note

The By default 'docker compose exec' allocates a TTY. part of the output is not entirely correct, given that the default value of the flag is !dockerCli.Out().IsTerminal() (source). It'd be more like, "By default 'docker compose exec' allocates a TTY when the output is a terminal."
Let me know if that sounds better and I'll update it in a separate PR.

(not mandatory) A picture of a cute animal, if possible in relation to what you did

image

@tonyo tonyo requested a review from a team as a code owner October 23, 2025 15:28
@tonyo tonyo requested review from glours and ndeloof October 23, 2025 15:28
@ndeloof
Copy link
Contributor

ndeloof commented Oct 23, 2025

For legal reasons, contributor MUST sign-off commits before we can merge. Please amend your commit with git commit --signoff --amend and force push

@tonyo tonyo force-pushed the tonyo/fix-backticks-exec branch from f0169d2 to 14835bc Compare October 23, 2025 15:34
@ndeloof ndeloof enabled auto-merge (rebase) October 23, 2025 15:34
@ndeloof
Copy link
Contributor

ndeloof commented Oct 23, 2025

Nice catch by the way, this surprising feature in pflags we probably could use to improve help messages in a few places

Copy link
Contributor

@glours glours left a comment

Choose a reason for hiding this comment

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

LGTM

@glours
Copy link
Contributor

glours commented Oct 23, 2025

@tonyo You need to run make docs to update the documentation files

auto-merge was automatically disabled October 23, 2025 15:43

Head branch was pushed to by a user without write access

@tonyo tonyo force-pushed the tonyo/fix-backticks-exec branch from 14835bc to 57ad5f2 Compare October 23, 2025 15:43
@tonyo
Copy link
Contributor Author

tonyo commented Oct 23, 2025

You need to run make docs to update the documentation files

Done 👍

@ndeloof ndeloof enabled auto-merge (rebase) October 23, 2025 16:08
@ndeloof ndeloof merged commit 8619f5d into docker:main Oct 23, 2025
25 checks passed
@codecov
Copy link

codecov bot commented Oct 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Nov 3, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [docker/compose](https://github.com/docker/compose) | patch | `v2.40.2` -> `v2.40.3` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>docker/compose (docker/compose)</summary>

### [`v2.40.3`](https://github.com/docker/compose/releases/tag/v2.40.3)

[Compare Source](docker/compose@v2.40.2...v2.40.3)

#### What's Changed

##### 🐛 Fixes

- Fix OCI compose override support by [@&#8203;ndeloof](https://github.com/ndeloof) [#&#8203;13311](docker/compose#13311)
- Fix help output for "exec --no-tty" option by [@&#8203;tonyo](https://github.com/tonyo) [#&#8203;13314](docker/compose#13314)
- Prompt default implementation to prevent a panic by [@&#8203;ndeloof](https://github.com/ndeloof) [#&#8203;13317](docker/compose#13317)
- Run hooks on restart by [@&#8203;ndeloof](https://github.com/ndeloof) [#&#8203;13321](docker/compose#13321)
- Fix(run): Ensure images exist only for the target service in run command by [@&#8203;idsulik](https://github.com/idsulik) [#&#8203;13325](docker/compose#13325)
- Fix(git): Fix path traversal vulnerability in git remote loader  by [@&#8203;idsulik](https://github.com/idsulik) [#&#8203;13331](docker/compose#13331)

##### 🔧  Internal

- Test to check writeComposeFile detects invalid OCI artifact by [@&#8203;ndeloof](https://github.com/ndeloof) [#&#8203;13309](docker/compose#13309)
- Code Cleanup by [@&#8203;ndeloof](https://github.com/ndeloof) [#&#8203;13315](docker/compose#13315)

##### ⚙️ Dependencies

- Bump compose-go to version v2.9.1 by [@&#8203;glours](https://github.com/glours) [#&#8203;13332](docker/compose#13332)

**Full Changelog**: <docker/compose@v2.40.2...v2.40.3>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNjkuMSIsInVwZGF0ZWRJblZlciI6IjQxLjE2OS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Dec 12, 2025
⚠️ **CAUTION: this is a major update, indicating a breaking change!** ⚠️

This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [docker/compose](https://github.com/docker/compose) | major | `v2.40.3` -> `v5.0.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>docker/compose (docker/compose)</summary>

### [`v5.0.0`](https://github.com/docker/compose/releases/tag/v5.0.0): &quot;Mont Blanc&quot;

[Compare Source](docker/compose@v2.40.3...v5.0.0)

![mont blanc](https://github.com/user-attachments/assets/1e6b938e-e67a-4063-b1d0-0f225da01521)

Major changes in this release:

- Compose can now officially be used as a SDK to be integrated into third-party softwares
- Internal builder has been removed, build is delegated to Docker Bake (same as `docker build` command)

#### Why "v5" ?

We decided to skip `3.0.0` for next major release after docker Compose v2 to prevent (more) confusion with the obsolete docker-compose file versions `2.x` and `3.x` inherited from Docker Compose v1. We also skipped `4.0.0` to have a clear separation with this legacy.

#### What's Changed

##### ✨ Improvements

- drop support for internal buildkit builder by [@&#8203;ndeloof](https://github.com/ndeloof) in [#&#8203;13056](docker/compose#13056)
- Setup Compose service using functional parameters by [@&#8203;ndeloof](https://github.com/ndeloof) in [#&#8203;13312](docker/compose#13312)
- Introduce abstractions to support SDK usage without requiring Docker CLI by [@&#8203;glours](https://github.com/glours) in [#&#8203;13313](docker/compose#13313)
- configure Compose service with io.Reader and io.Writer by [@&#8203;glours](https://github.com/glours) in [#&#8203;13322](docker/compose#13322)
- Make progress Writer a CLI component by [@&#8203;ndeloof](https://github.com/ndeloof) in [#&#8203;13316](docker/compose#13316)
- SDK docs by [@&#8203;ndeloof](https://github.com/ndeloof) in [#&#8203;13350](docker/compose#13350)
- document support for OCI and Git remote resources by [@&#8203;ndeloof](https://github.com/ndeloof) in [#&#8203;13362](docker/compose#13362)
- run hooks on restart by [@&#8203;ndeloof](https://github.com/ndeloof) in [#&#8203;13321](docker/compose#13321)
- fix(run): Ensure images exist only for the target service in run command by [@&#8203;idsulik](https://github.com/idsulik) in [#&#8203;13325](docker/compose#13325)
- Add load project to api definition by [@&#8203;glours](https://github.com/glours) in [#&#8203;13329](docker/compose#13329)
- introduce --insecure-registry, reserved for testing purpose by [@&#8203;ndeloof](https://github.com/ndeloof) in [#&#8203;13355](docker/compose#13355)
- Move progress package to cmd as a command line component by [@&#8203;ndeloof](https://github.com/ndeloof) in [#&#8203;13357](docker/compose#13357)
- Added support for `build.no_cache_filter` by [@&#8203;ndeloof](https://github.com/ndeloof) in [#&#8203;13377](docker/compose#13377)
- add --wait option to start command by [@&#8203;ndeloof](https://github.com/ndeloof) in [#&#8203;13409](docker/compose#13409)

##### 🐛 Fixes

- fix OCI compose override support by [@&#8203;ndeloof](https://github.com/ndeloof) in [#&#8203;13311](docker/compose#13311)
- Fix help output for "exec --no-tty" option by [@&#8203;tonyo](https://github.com/tonyo) in [#&#8203;13314](docker/compose#13314)
- fix typo in error message by [@&#8203;stasadev](https://github.com/stasadev) in [#&#8203;13328](docker/compose#13328)
- disable progress UI when build is ran with --print by [@&#8203;ndeloof](https://github.com/ndeloof) in [#&#8203;13351](docker/compose#13351)
- add (restore) support for detach keys by [@&#8203;ndeloof](https://github.com/ndeloof) in [#&#8203;13369](docker/compose#13369)
- images command should display image Created time or N/A if not available by [@&#8203;ndeloof](https://github.com/ndeloof) in [#&#8203;13376](docker/compose#13376)
- Fix support for port range by [@&#8203;ndeloof](https://github.com/ndeloof) in [#&#8203;13381](docker/compose#13381)
- skip includes preparing publish by [@&#8203;ndeloof](https://github.com/ndeloof) in [#&#8203;13400](docker/compose#13400)
- feat(model): ignore runtime flags in model configuration by [@&#8203;ilopezluna](https://github.com/ilopezluna) in [#&#8203;13404](docker/compose#13404)

##### 🔧  Internal

- Next release will be major version v5.x by [@&#8203;ndeloof](https://github.com/ndeloof) in [#&#8203;13375](docker/compose#13375)
- Test to check writeComposeFile detects invalid OCI artifact by [@&#8203;ndeloof](https://github.com/ndeloof) in [#&#8203;13309](docker/compose#13309)
- Code Cleanup by [@&#8203;ndeloof](https://github.com/ndeloof) in [#&#8203;13315](docker/compose#13315)
- fix various linting issues by [@&#8203;thaJeztah](https://github.com/thaJeztah) in [#&#8203;13326](docker/compose#13326)
- Making the American/British spellings consistent to the error messages by [@&#8203;JLesDev](https://github.com/JLesDev) in [#&#8203;13366](docker/compose#13366)
- gha: test against docker v29, v28, and rename checks to use `stable`, `oldstable` by [@&#8203;thaJeztah](https://github.com/thaJeztah) in [#&#8203;13380](docker/compose#13380)
- refactor: replace Split in loops with more efficient SplitSeq by [@&#8203;vicerace](https://github.com/vicerace) in [#&#8203;13393](docker/compose#13393)
- refactor: use strings.Builder to improve performance by [@&#8203;liuyueyangxmu](https://github.com/liuyueyangxmu) in [#&#8203;13398](docker/compose#13398)
- Fix grammar: change 'adopted' to 'adopt' in Docker Swarm note by [@&#8203;rashmivagha](https://github.com/rashmivagha) in [#&#8203;13407](docker/compose#13407)
- golangci-lint: use gci formatter instead of goimports by [@&#8203;thaJeztah](https://github.com/thaJeztah) in [#&#8203;13406](docker/compose#13406)
- refactor: replace interface{} with any for clarity and modernization by [@&#8203;zjumathcode](https://github.com/zjumathcode) in [#&#8203;13411](docker/compose#13411)

##### ⚙️ Dependencies

- Bump compose go to v2.10.0 by [@&#8203;ndeloof](https://github.com/ndeloof) in [#&#8203;13410](docker/compose#13410)
- build(deps): bump github.com/containerd/platforms from 1.0.0-rc.1 to 1.0.0-rc.2 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;13353](docker/compose#13353)
- build(deps): bump github.com/docker/docker from 28.5.1+incompatible to 28.5.2+incompatible by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;13361](docker/compose#13361)
- build(deps): bump github.com/containerd/containerd/v2 from 2.1.4 to 2.2.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;13358](docker/compose#13358)
- build(deps): bump github.com/docker/cli from 28.5.1+incompatible to 28.5.2+incompatible by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;13360](docker/compose#13360)
- build(deps): bump golang.org/x/sys from 0.37.0 to 0.38.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;13367](docker/compose#13367)
- build(deps): bump golang.org/x/sync from 0.17.0 to 0.18.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;13368](docker/compose#13368)
- Dockerfile: update golangci-lint to v2.6.2 by [@&#8203;thaJeztah](https://github.com/thaJeztah) in [#&#8203;13370](docker/compose#13370)
- build(deps): bump buildx v0.30.0, buildkit v0.26.0, otel v1.38.0, otel/contrib v0.63.0 by [@&#8203;thaJeztah](https://github.com/thaJeztah) in [#&#8203;13379](docker/compose#13379)
- bump dependencies by [@&#8203;ndeloof](https://github.com/ndeloof) in [#&#8203;13392](docker/compose#13392)
- build(deps): bump github.com/hashicorp/go-version from 1.7.0 to 1.8.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;13403](docker/compose#13403)
- build(deps): bump golang.org/x/crypto v0.45.0 by [@&#8203;thaJeztah](https://github.com/thaJeztah) in [#&#8203;13405](docker/compose#13405)

#### New Contributors

- [@&#8203;tonyo](https://github.com/tonyo) made their first contribution in [#&#8203;13314](docker/compose#13314)
- [@&#8203;stasadev](https://github.com/stasadev) made their first contribution in [#&#8203;13328](docker/compose#13328)
- [@&#8203;JLesDev](https://github.com/JLesDev) made their first contribution in [#&#8203;13366](docker/compose#13366)
- [@&#8203;vicerace](https://github.com/vicerace) made their first contribution in [#&#8203;13393](docker/compose#13393)
- [@&#8203;liuyueyangxmu](https://github.com/liuyueyangxmu) made their first contribution in [#&#8203;13398](docker/compose#13398)
- [@&#8203;ilopezluna](https://github.com/ilopezluna) made their first contribution in [#&#8203;13404](docker/compose#13404)
- [@&#8203;rashmivagha](https://github.com/rashmivagha) made their first contribution in [#&#8203;13407](docker/compose#13407)
- [@&#8203;zjumathcode](https://github.com/zjumathcode) made their first contribution in [#&#8203;13411](docker/compose#13411)

**Full Changelog**: <docker/compose@v2.40.2...v5.0.0>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi4zMC40IiwidXBkYXRlZEluVmVyIjoiNDIuMzAuNCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
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.

3 participants