Add logging while waiting for services#13461
Closed
mjagyo wants to merge 3 commits intodocker:mainfrom
Closed
Conversation
ndeloof
reviewed
Dec 16, 2025
| Viz(ctx context.Context, project *types.Project, options VizOptions) (string, error) | ||
| // Wait blocks until at least one of the services' container exits | ||
| Wait(ctx context.Context, projectName string, options WaitOptions) (int64, error) | ||
| Wait(ctx context.Context, projectName string, consumer LogConsumer, options WaitOptions) (int64, error) |
Contributor
There was a problem hiding this comment.
this is a breaking change in the API, better pass LogConsumer as a new attribute in WaitOptions struct
ndeloof
reviewed
Dec 16, 2025
| flags.StringArrayVar(&up.noAttach, "no-attach", []string{}, "Do not attach (stream logs) to the specified services") | ||
| flags.BoolVar(&up.attachDependencies, "attach-dependencies", false, "Automatically attach to log output of dependent services") | ||
| flags.BoolVar(&up.wait, "wait", false, "Wait for services to be running|healthy. Implies detached mode.") | ||
| flags.BoolVar(&up.log, "log", false, "Run in attached mode and stream service logs") |
Contributor
There was a problem hiding this comment.
I'm fine we attach to containers during wait phase by default, this seems a reasonable behavior. Users who prefer the legacy behavior (maybe in a script) can configure compose to detach or redirect output
Contributor
|
For legal reasons, all commits must be signed-off. Please amend your commit with --signoff |
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce a --log flag for
docker compose waitanddocker compose up --waitto emit progress output while services are starting.