diff --git a/lib/create-container.js b/lib/create-container.js index 46085ed..86ad820 100644 --- a/lib/create-container.js +++ b/lib/create-container.js @@ -29,7 +29,18 @@ function pull (docker, image, done) { streamc .pipe(es.map(function (data, cb) { - cb(null, JSON.parse(data)) + var json_data = null + + try { + json_data = JSON.parse(data.toString()) + } catch (error) { + json_data = { + type: 'stdout', + data: data.toString() + } + } + + cb(null, json_data) })) .on('data', function (event) { debug('pull event: ' + inspect(event));