-
Notifications
You must be signed in to change notification settings - Fork 243
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
No progress bar in docker logs #651
Comments
I think this is more or less intentional -- indicatif checks whether the stream it is attached to is a terminal, which is probably not the case in this scenario. I think #530 covers this scenario. |
Oop, sorry for not replying for a while. Could you explain a bit more why this happens when output is being written to a file, so i can search for a solution? |
It is intentional, as @djc mentioned. The underlying reason is that it is hard to say what should actually be written to the file. Should we write the progress bar just once (when it is 'complete'), or each time the progress ticks? What about every time the status text changes? etc etc etc. A workaround, as mentioned in @530, is to use the 'unbuffer' tool: https://linux.die.net/man/1/unbuffer. |
Im not sure how
|
I'm still not quite sure what you're trying to do, but perhaps this will help: chris-laplante/fuzzy-octo-pancake@6cb2eb1. It uses unbuffer to capture the output to a file called out.txt, then prints the contents of that file after the program is done. When I run it, I get:
|
Sadly i need real-time progress bar updates, or at least close to it |
Real-time but where? Printed to a file, or output to the console? |
in |
I'd prefer to keep this discussion in #530 so we have all of it in one place. I think it would make sense to expose some API to override the implicit terminal detection logic. |
When you run an app that has a progress bar it won't be rendered when attaching to container logs, but will be present if ran via
cargo run
Sample repo: https://github.com/funlennysub/fuzzy-octo-pancake
Steps to reproduce:
cargo run -r
- progress bar will be displayeddocker build --tag 'whatever' .
docker run 'whatever'
- progress bar won't be displayedThe text was updated successfully, but these errors were encountered: