Some of docker-compose output is sent neither on stdout nor on stderr
using the following compose file:
---
version: '2'
services:
aaa:
image: ubuntu:16.10
running the following:
docker-compose -f compose.yml pull
I get:
Pulling aaa (ubuntu:16.10)...
16.10: Pulling from library/ubuntu
30179d74c3a2: Pulling fs layer
29eedd999b59: Download complete
155740d76144: Download complete
ec1b1466d64c: Waiting
01af7eecc784: Waiting
However, running the following:
docker-compose -f compose.yml pull > pull.stdout 2> pull.stderr
And then looking at stdout or stderr, I don't see any of the "pulling"/"download complete" parts. Where are they hiding?
~$ cat pull.stdout
16.10: Pulling from library/ubuntu
~$ cat pull.stderr
Pulling aaa (ubuntu:16.10)...
Aborting.
Is that behaviour documented/expected? What stream is used for the messages that don't show up?
Many thanks, Avidan
By design, some output (progress bars and such) is suppressed when the output stream is not a TTY.
Got it, thanks
@shin- Is there any plan to add some basic progress messages when the output stream is redirected?
I'm from Visual Studio Container Tools team. We redirect the output from docker-compose to Visual Studio's output panel, when compose is pulling large image (windows container image etc.), due to the lacking of the progress output, user often think the process is hanging.
There is no plan for this currently. I'm happy to consider it if someone submits a PR however!
On Thu, May 18, 2017, 3:53 PM Yanchen Wu [email protected] wrote:
@shin- https://github.com/shin- Is there any plan to add some basic progress messages when the output stream is redirected?
I'm from Visual Studio Container Tools team. We redirect the output from docker-compose to Visual Studio's output panel, when compose is pulling large image (windows container image etc.), due to the lacking of the progress output, user often think the process is hanging.
— You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/docker/compose/issues/4780#issuecomment-302563262, or mute the thread https://github.com/notifications/unsubscribe-auth/ABCVnP5Yk1Cf0zp2N5N8jk705AoTNKvDks5r7MwBgaJpZM4NMqqH .
Hello @shin- ,
The behavior of Docker Compose is really not clear to me. If I redirect the STDERR to a file, I would expect that Compose will not print TTY chars in that file. But I can clearly see special TTY characters in there despite I'm redirecting output to a not-TTY stream. I think if someone redirects the logs to a not-TTY output, it should not print any special characters, what do you think?
Restarting appswarmui_frontend_1 ...
Restarting appswarmui_identifier_1 ...
Restarting appswarmui_dispatcher_1 ...
Restarting appswarmui_resource_1 ...
Restarting appswarmui_delta_1 ...
Restarting appswarmui_swarm-admin_1 ...
Restarting appswarmui_db_1 ...
Restarting appswarmui_docker_1 ...
[2A[2K
Restarting appswarmui_db_1 ... done
[2B[1A[2K
Restarting appswarmui_docker_1 ... done
[1B[5A[2K
Restarting appswarmui_resource_1 ... done
[5B[4A[2K
Restarting appswarmui_delta_1 ... done
[4B[8A[2K
Restarting appswarmui_frontend_1 ... done
[8B[3A[2K
Restarting appswarmui_swarm-admin_1 ... done
[3B[6A[2K
Restarting appswarmui_dispatcher_1 ... done
[6B[7A[2K
Restarting appswarmui_identifier_1 ... done
[7B
@cecton We actually went back and forth on this issue, see #4408 . It's not clear cut what the best behavior is - as I mentioned, I think this would ideally be handled with a separate CLI flag.
thanks @shin- I will make PR then with a command line flag. Any preference for the flag name?
Fixed in #4951