-
Notifications
You must be signed in to change notification settings - Fork 2k
Piping data from the host into docker container command not working with docker machine #4235
Comments
If you run with I'm pretty sure SSH allocates a TTY automatically, but if you pass |
@dragon788 Doesn't work. This is what I get:
PS I'm using ConEmu terminal |
Oh it seems to be ConEmu-specific. I tried running the command in GitBash and it works:
|
Looks like this might be related: moby/moby#28814 With the workaround suggested in this comment I managed to make it work with ConEmu:
|
Relevant ticket in ConEmu issue tracker: Maximus5/ConEmu#958 Seems that this is a Docker issue. |
Duplicate of moby/moby#28814 |
I was having this error, and then after doing @jannis-baratheon's ANSI fix I then received a different error:
As the error suggests, simply prefixing the command with 'winpty' makes things work in conemu. Thanks! |
Bumping; As of now it's not possible to both pipe data into a docker command and receive its output using just these flags. No clear indication how to do so otherwise. |
I've posted this on StackOverflow too: https://stackoverflow.com/questions/45811792/piping-data-from-the-host-into-docker-container-command-not-working-with-docker/45917058
The problem
I'm running Docker on Windows 10 hosted using docker-machine. I'm trying to pipe data from host into a container spawn with 'docker run' with this command:
I'd expect this command to output 'test' to the stdout, but all it does is print a blank line:
However when I ssh into the docker-machine the command works as expected:
Can someone tell me:
PS I'm using GitBash environment (based on MSYS2/MINGW) on my Windows 10 machine. Version info:
Current workaround
For now I'm using a workaround. I'm saving the payload I want piped to a local file, then transferring the file into the container with
docker cp
and next piping it locally within container.To sum up:
What I want to do and doesn't work with
docker-machine
is:Instead I do this:
The text was updated successfully, but these errors were encountered: