Skip to content

Troubles with demuxStream called from docker.run #159

@q0rban

Description

@q0rban

I am trying to pass in a stdout and stderr array of streams from docker.run() in dockerode. Something like this:

    const stdout = new stream.PassThrough();
    const stderr = new stream.PassThrough();
    await docker.run(someimage, ['some', 'command'], [stdout, stderr]);

When I pass things in this way, nothing gets output to stdout or stderr streams. However, when I do the following, I do get the output I expect:

    const stdout = new stream.PassThrough();
    await docker.run(someimage, ['some', 'command'], stdout);

I've tracked this down to demuxStream in docker-modem, but I'm having trouble making sense of how it's supposed to work. In my testing, nextDataLength is always a very large integer that is much larger than the buffer.length, so the conditional statement that then writes to the streams is never called. I don't really understand buffers much, so I'm not sure if I'm just implementing something incorrectly, or if there is a bug.

I was wondering if it had something to do with endianess, as I am on an arm processor, but I had a coworker try on an intel processor and they had the same issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions