-
-
Notifications
You must be signed in to change notification settings - Fork 465
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
stream pipe problem? #237
Comments
I got same issue. No output from a running container with 'follow: true'. |
Possible solution
|
I'm working with the .logs API right now as well, and I am able to get data out of the stream but it is never sends an "end" event, anybody have any insight as to why that would be case. my code looks like this: (I'm using server sent events to write output to the client that is the parts that you can see in this code)
I get data out of the .logs stream but like I said it never hits stream.end |
So my issue here was I had {follow: true} on my log options. That causes end to never be called. Once I removed that I was able to have my .logs working without any issue. |
Working with the logging API as well, getting the following error:
|
Have the same Problem. It looks that the response stream object is type of string. const docker = new Docker({
socketPath: '/var/run/docker.sock'
});
const container = docker.getContainer('123456');
container.logs({
stdout: true,
stderr: true
}, function(err, stream){
if(err) {
return logger.error(err.message);
}
console.log(typeof stream); // string
}) |
Old issue, if needed it will be reopened. |
i use restify http server ,code below:
server.get('/api/container/:id/logs', function create(req, res, next) {
var opts={
follow: true,
stdout: true,
stderr: true
};
var c=docker.getContainer(req.params.id);
c.logs(opts,function(err,stream){
if(!err){
stream.pipe(res); //but nothing response?
}
});
});
The text was updated successfully, but these errors were encountered: