Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion commands/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ func runBuild(ctx context.Context, dockerCli command.Cli, options buildOptions)
}

var term bool
if _, err := console.ConsoleFromFile(os.Stderr); err == nil {
if _, err := console.ConsoleFromFile(os.Stdout); err == nil {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not sure what you're trying to achieve with this change. This func just checks if provided "file" is a console.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If you meant to have progress output to stdout this is not something we are going to do. Progress, diagnostics or logs go to stderr. See also moby/buildkit#1186 (comment)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

it's not that? currently docker build ... 2>&1 | tee switches to plain text and docker build ... | tee does not. with this change it would in the latter case.

Copy link
Copy Markdown
Member

@tonistiigi tonistiigi Apr 29, 2024

Choose a reason for hiding this comment

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

Stdout is used for build result with -o. This change makes it so that buildx -o type=tar does not produce TTY output anymore. Use --progress to control what kind of output you wish to achieve.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

ok, i've opened appveyor/build-images#152. the issue was with docker-build cluttering the logs in appveyor ci, because unlike github actions, appveyor does not run the job with redirected output and it keeps on printing the whole dockerfile content with every progress line... 60k+ lines in logs from RUN apt install ... alone in debian container.

expecting everyone to specify the progress=plain is bit counter-intuitive. perhaps docker can check for CI=ignorecase(true) and CI=1 well-known environment variable for CI systems in the wild and make the decision for the user? avid users can still optin to (broken) tty logs.

term = true
}
attributes := buildMetricAttributes(dockerCli, b, &options)
Expand Down