From 9bef1bcf646335557e0f2f5afb89c5d3761d4b8a Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Wed, 23 Aug 2017 13:25:32 +0200 Subject: [PATCH] Hijack and demux the container exec stream to be compliant with new dockerode --- src/janitor.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/janitor.js b/src/janitor.js index 59c1b9d35..eadfd4484 100644 --- a/src/janitor.js +++ b/src/janitor.js @@ -70,14 +70,13 @@ function cleanupTmpVolume(containerInfo, callback) { docker.getContainer(containerInfo.Id).exec({ Cmd: cmd, AttachStdout: true, AttachStderr: true, Tty: false }, function (error, execContainer) { if (error) return callback(new Error('Failed to exec container : ' + error.message)); - execContainer.start(function(err, stream) { + execContainer.start({ hijack: true }, function (error, stream) { if (error) return callback(new Error('Failed to start exec container : ' + error.message)); stream.on('error', callback); stream.on('end', callback); - stream.setEncoding('utf8'); - stream.pipe(process.stdout); + docker.modem.demuxStream(stream, process.stdout, process.stderr); }); }); }