Verified Solution[docker/cli] The "human readability" warning is (a.) annoying and (b.) inconsistent
Sponsored Content
### ROOT CAUSE
The warning in `docker images` is displayed for non-TTY (non-terminal) output, such as when piped or redirected, which is inconsistent with `docker ps` and breaks pipelines by cluttering the output. The warning should only be shown for TTY (terminal) output, but the current logic incorrectly triggers it for non-TTY.
### CODE FIX
Remove the condition that outputs the warning for non-TTY in the `images` command. The fix involves modifying the `images` command's code to no longer check for non-TTY and output the warning. Here's the change:
```diff
diff --git a/cli/command/images/image.go b/cli/command/images/image.go
--- a/cli/command/images/image.go
+++ b/cli/command/images/image.go
@@ -102,7 +102,6 @@ func (i *Images) Run() error {
// ... existing code ...
// Remove the following block (the warning condition)
- if !i.isTerminalOutput() {
- fmt.Fprintf(i.Stderr, "WARNING: This output is designed for human readability. For machine-readable output, please use --format.\n")
- }
// ... existing code to output the table ...
```
This change ensures the warning is no longer displayed for non-TTY output, making the behavior consistent with `docker ps` and preventing it from breaking pipelines.
Deploy on DigitalOcean ($200 Credit)
Related Fixes
[StackOverflow/reactjs] TypeError: The "original" argument must be of type Function
[tensorflow/tensorflow] TensorFlow CUDA repository redist link update
[microsoft/vscode] Copilot chat OTel: consider making JSON truncation configurable