compose icon indicating copy to clipboard operation
compose copied to clipboard

Some of docker-compose output is sent neither on stdout nor on stderr

Open avidan-efody opened this issue 9 years ago • 8 comments

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

avidan-efody avatar Apr 30 '17 19:04 avidan-efody

By design, some output (progress bars and such) is suppressed when the output stream is not a TTY.

shin- avatar May 01 '17 21:05 shin-

Got it, thanks

avidan-efody avatar May 04 '17 07:05 avidan-efody

@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.

yanchenw avatar May 18 '17 22:05 yanchenw

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 .

shin- avatar May 19 '17 00:05 shin-

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 ... 

Restarting appswarmui_db_1 ... done

Restarting appswarmui_docker_1 ... done

Restarting appswarmui_resource_1 ... done

Restarting appswarmui_delta_1 ... done

Restarting appswarmui_frontend_1 ... done

Restarting appswarmui_swarm-admin_1 ... done

Restarting appswarmui_dispatcher_1 ... done

Restarting appswarmui_identifier_1 ... done


cecton avatar May 22 '17 08:05 cecton

@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.

shin- avatar Jun 15 '17 00:06 shin-

thanks @shin- I will make PR then with a command line flag. Any preference for the flag name?

cecton avatar Jun 15 '17 06:06 cecton

Fixed in #4951

shin- avatar Aug 10 '17 02:08 shin-