Skip to content

Instantly share code, notes, and snippets.

@hirokiky
Created May 19, 2016 01:36
Show Gist options
  • Save hirokiky/88c4e423aaecfc6137ed0ccb75af3618 to your computer and use it in GitHub Desktop.
Save hirokiky/88c4e423aaecfc6137ed0ccb75af3618 to your computer and use it in GitHub Desktop.
Writing files by dockerode
container.exec({Cmd: ['/bin/sh', '-c', 'cat > /path/to/test.txt], AttachStdin: true}, (err, exec) => {
exec.start({hijack: true, stdin: true}, function(err, stream) {
stream.write("Hi there.\n")
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment