dockerode icon indicating copy to clipboard operation
dockerode copied to clipboard

logs command with follow not emitting any new entries

Open GCSBOSS opened this issue 3 years ago • 0 comments

Hi! For some reason, I can't get any new data out of the log command.

  • Running Windows 10.
  • Docker desktop default WSL2 setup.
  • Connecting to /var/run/docker.sock via volume

Here's my code

var logStream = new stream.PassThrough();
logStream.on('data', chunk => {
    console.log('HERE');
});

let stream = await c.logs({ 
    timestamps: false, 
    tail: 1, 
    stdout: true, 
    stderr: true, 
    follow: true 
});
c.modem.demuxStream(stream, logStream, logStream);
stream.on('error', console.log);
stream.on('end', function(){
    console.log('!stoppppppppppppppppp!');
    logStream.end('!stop!');
});

It will print 'HERE' only once because of the tail. Then if my container sends stuff to stdout/stderr, nothing happens. Other docker commands work normally.

Do you guys have any idea what might be off?

Thanks!

GCSBOSS avatar Mar 26 '21 16:03 GCSBOSS