Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

writing to stdin #5

Closed
jaredly opened this issue Oct 18, 2013 · 10 comments
Closed

writing to stdin #5

jaredly opened this issue Oct 18, 2013 · 10 comments

Comments

@jaredly
Copy link

jaredly commented Oct 18, 2013

If this is currently supported by dockerode, could you include a test / example of attaching to a container's stdin? And if it's not supported, what are the chances of that happening?

Thanks!

@apocas
Copy link
Owner

apocas commented Oct 18, 2013

Check the "duplex" branch :)
But it needs to be tested.

Basically it uses a duplex stream encapsulating req and res. It was hacked in 5 mins.
Right now it is failling the test suite on image building and creation.

I will probably look into it this weekend, since I also need it for other issue. #2

@jaredly
Copy link
Author

jaredly commented Oct 18, 2013

cool. Right now I'm going with manual websockets. Unfortunately I can't get
websockets working w/ unix sockets :( but local tcp works great.

On Fri, Oct 18, 2013 at 2:02 PM, Pedro Dias notifications@github.comwrote:

Check the "duplex" branch :)
But it needs to be tested.

Basically it uses a duplex stream encapsulating req and res. It was hacked
in 5 mins.
Right now it is failling the test suite on image building and creation.

I will probably look into this this weekend, since I also need it for
other issue. #2 #2


Reply to this email directly or view it on GitHubhttps://github.com//issues/5#issuecomment-26625481
.

@apocas
Copy link
Owner

apocas commented Oct 18, 2013

Yeah I've the same problem in here with ws and unixsocket.
I've open an issue websockets/ws#236 on their repo about this.

@jaredly
Copy link
Author

jaredly commented Oct 18, 2013

unfortunately, I think there's a docker issue too:
http://stackoverflow.com/questions/19456237/docker-websocket-attach-using-unix-sockets

On Fri, Oct 18, 2013 at 2:13 PM, Pedro Dias notifications@github.comwrote:

Yeah I've the same problem in here with ws and unixsocket.
I've open an issue websockets/ws#236https://github.com/einaros/ws/issues/236on their repo about this.


Reply to this email directly or view it on GitHubhttps://github.com//issues/5#issuecomment-26626215
.

@vincentwoo
Copy link
Contributor

Would very much like to be able to do this as well. Could you also provide docks on consuming regular stdout streams? I'm having trouble passing in a duplex stream and getting output.

@apocas
Copy link
Owner

apocas commented Dec 3, 2013

stdin attach via remote api is still in a limbo right now, till I figure out how to do it.

Could you detail your second question?

You can easily attach and separate stderr and stdout, example:
container.attach({stream: true, stdout: true, stderr: true, tty: false}, function(err, stream) {
container.modem.demuxStream(stream, process.stdout, process.stderr);
});

@vincentwoo
Copy link
Contributor

I figured out my issue - I'm a total stream novice, and didn't realize I needed to override stream._write to get any output.

@apocas
Copy link
Owner

apocas commented Dec 4, 2013

No problem :)
BTW, Passthrough stream from streams2 is cool for that, since you don't need to override a lot of stuff :)
http://nodejs.org/api/stream.html#stream_class_stream_passthrough

Regarding stdin attach a lot of people is having issues with it via plain remote api.
Via websockets theres the issue you read above.

So right now it's in limbo.

@nuxlli nuxlli mentioned this issue Jan 31, 2014
@apocas
Copy link
Owner

apocas commented Feb 2, 2014

Fixed in #38

@apocas apocas closed this as completed Feb 2, 2014
@jaredly
Copy link
Author

jaredly commented Feb 2, 2014

Awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants