-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suport Re-Following Logs on Single Service Restart #10331
Comments
Marking this as a bug, compose can detect service container is restarting, should not exit |
@ndeloof we had a discussion about this on #10181, it's not that clear (and not a bug unless we want to change behavior from V1). It works fine when there is a Compose file with multiple services (as logs doesn't exit, the new service starts and we reattach) but this issue is for when the Compose file only has 1 service defined. In that case, if a user runs In the comment in #10181 (comment), you mentioned that The issue here is what to do when user runs |
@laurazard I recently introduced a mechanism for compose to know a container is restarted, see #10236 |
As we are stuck with docker engine limitation not to populate |
Description
When following logs via
docker compose up
ordocker compose logs -f
, the command automatically re-follows container logs when a service is restarted but only if multiple services are running. If only one service is running, the command detaches instead.It would be handy to have the ability to re-follow logs even if only one service is running (e.g., via a new parameter).
For context, I'm currently writing a CLI wrapper that starts a docker compose application with two services, one of which is optionally activated via a profile. The primary service needs to be periodically restarted. When both services are running,
docker compose up
automatically reattaches to the container so the wrapper can simply continue printing results from STDOUT. When only one service is running, however, I need to restart the service, wait for it to be up, and re-attach. It would be nice to instead be able to consistently re-follow logs for both scenarios.The text was updated successfully, but these errors were encountered: