ClusterHQ / powerstrip

Powerstrip: A tool for prototyping Docker extensions
https://clusterhq.com/
Apache License 2.0
302 stars 32 forks source link

Streaming output only happens for -ti flag #56

Open binocarlos opened 9 years ago

binocarlos commented 9 years ago

When I do this using DOCKER_HOST=tcp://127.0.0.1:2375 (i.e. pointing @ powerstrip):

docker run --rm -ti ubuntu echo hello - it outputs hello

But when I do this:

docker run --rm ubuntu echo hello - it outputs nothing

Whereas when I do the same thing without pointing at powerstrip - it outputs hello for both scenarios.

There must be a flag in powerstrip that depends on either -t or -i that enables streaming mode - we need to do this for any attach mode - hope this makes sense.

lukemarsden commented 9 years ago

We've dug into this and the really weird thing is that docker run ubuntu echo hello works (which, I think, relies on the TCP half-close trick here) when powerstrip is run outside a container. When powerstrip is run inside a container, and port 2375 exposed via -p "2375:2375", docker run ubuntu echo hello does not work.

lukemarsden commented 9 years ago

Current hypothesis is that something to do with the Docker iptables NAT rules is interfering with the TCP half-close.

lukemarsden commented 9 years ago

screenshot 2015-02-20 17 24 29

FTR, this is the difference between powerstrip running outside a container (LHS) vs powerstrip running inside a container. This behaviour is the same both with the golang and Twisted versions.

lukemarsden commented 9 years ago

Proposed workaround presently is to make Docker bind to a UNIX socket rather than a port, bypassing the (currently unproven) Docker NAT half-close issues.

lukemarsden commented 9 years ago

Demonstrated working in https://github.com/ClusterHQ/powerstrip/compare/unix-socket