Skip to content

Conversation

@glours
Copy link
Contributor

@glours glours commented Sep 18, 2025

What I did
Checked if run is started from a piped command such as echo test | docker compose run my-service, if this is the case and the user don't change any tty related flags then we automatically pass in no-Tty mode.

Related issue
Fixes #13228

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

@glours glours requested a review from a team as a code owner September 18, 2025 15:41
@glours glours requested a review from ndeloof September 18, 2025 15:41
}
}
//Check if the command was piped or not
stdinInfo, err := os.Stdin.Stat()
Copy link
Contributor

Choose a reason for hiding this comment

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

why don't you use dockerCli.stdin().IsTerminal ?

Copy link
Contributor Author

@glours glours Sep 18, 2025

Choose a reason for hiding this comment

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

Fixed!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But unfortunately don't behave like the os.Stdin.Stat() check, it still have the the input device is not a TTY error when checking the cli stdin with IsTerminal

@glours glours force-pushed the do-not-default-it-stdin-not-tty branch 2 times, most recently from 3abcff4 to be34b30 Compare September 18, 2025 17:08
@glours glours force-pushed the do-not-default-it-stdin-not-tty branch from be34b30 to b10d73b Compare September 19, 2025 07:27
Co-authored-by: Nicolas De loof <[email protected]>
Signed-off-by: Guillaume Lours <[email protected]>
@glours glours enabled auto-merge (rebase) September 19, 2025 07:48
@glours glours merged commit 5aea947 into docker:main Sep 19, 2025
26 checks passed
@glours glours deleted the do-not-default-it-stdin-not-tty branch September 19, 2025 07:51
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Sep 22, 2025
This MR contains the following updates:

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

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.39.4`](https://github.com/docker/compose/releases/tag/v2.39.4)

[Compare Source](docker/compose@v2.39.3...v2.39.4)

#### What's Changed

##### ✨ Improvements

- Add support of `develop.watch.initial_sync` attribute by [@&#8203;glours](https://github.com/glours) in [#&#8203;13232](docker/compose#13232)

##### 🐛 Fixes

- Volume ls command can run without a project by [@&#8203;ndeloof](https://github.com/ndeloof) in [#&#8203;13221](docker/compose#13221)
- Fix support for build with bake when target docker endpoint requires TLS by [@&#8203;ndeloof](https://github.com/ndeloof) in [#&#8203;13231](docker/compose#13231)
- Disable Tty if `run` command started from a piped command by [@&#8203;glours](https://github.com/glours) in [#&#8203;13233](docker/compose#13233)

##### 🔧  Internal

- Test: Set stop\_signal to SIGTERM by [@&#8203;ricardobranco777](https://github.com/ricardobranco777) in [#&#8203;13214](docker/compose#13214)

##### ⚙️ Dependencies

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

#### New Contributors

- [@&#8203;ricardobranco777](https://github.com/ricardobranco777) made their first contribution in [#&#8203;13214](docker/compose#13214)

**Full Changelog**: <docker/compose@v2.39.3...v2.39.4>

</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:eyJjcmVhdGVkSW5WZXIiOiI0MS4xMTguMCIsInVwZGF0ZWRJblZlciI6IjQxLjExOC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
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.

[BUG] Error when stdin is not a TTY but stdout is a TTY

2 participants