-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
When I run container.attach(stdout=True, stderr=True, stream=True, logs=True), the resulting generator contains the output of stdout and stderr multiplexed into one string. I would like to separate to get stdout and stderr in separate generators (or) streams.
I know the Go SDK contains a stdcopy.StdCopy precisely for the purpose of demuxing the output given a raw socket. I would like to implement something similar for the Docker Python SDK as well.
I need this for my project, so I am going to implement anyway, but would you be open to the idea of my contributing the patch back to this project? Actually most of the functionality is already implemented in socket.py. Instead of discarding the frame type, I will pass it out and have the caller decide how to handle it. The attach() method will discard the type, whereas, a new docker.util.demuxSocketOutput(stdout_stream, stderr_stream) will write the output to respective the streams.
Would you be open to this idea? I send a PR.