Closed yamalight closed 7 years ago
Docker method to be used is Exec Create. Dockerode has Container.exec method for it.
Following code creates the interactive exec session and pipes stdin to container:
const options = {
Cmd: ['bash'],
Tty: true,
AttachStdin: true,
AttachStdout: true,
AttachStderr: true,
};
const exec = await container.execAsync(options);
const stream = await exec.startAsync({stdin: true});
container.modem.demuxStream(stream, process.stdout, process.stderr);
process.stdin.pipe(stream);
Challenges:
Closing since core has changed significantly.
Investigate if it's possible to provide direct shell access to running services. Question is basically - can you proxy shell with REST? (websockets?)