-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
exec in interactive mode #57
Comments
Hi @JulienB37, did you get this working? If so, can you post your code please? Did you stream input to the container's stdin? |
hi, And finally i use docker with chid_process to execute a docker command in interactive mode
If someone has a better solution it would be nice |
I ended up with a hacky solution by accessing the import { tarStream } from 'tar-stream';
// The outgoing tar compression stream
const tarCompressor = tarStream();
const syncContainer = await docker.container.create({
Binds: volumesToSync,
Cmd: ['sleep', 'infinity'],
Image: 'stemn/development-environment:latest',
});
await syncContainer.start();
// Create a tar extractor pointng at the root of the filesystem
const tarExtractorExec = await syncContainer.exec.create({
AttachStdin: true,
Cmd: ['tar', 'xf', '-'],
OpenStdin: true,
WorkingDir: '/',
});
// The receiving tar extractor stdio stream
const tarExtractor = await tarExtractorExec.start();
// Pipe the tar compression stream to the standard input of the tar extractor
tarCompressor.pipe(tarExtractor.connection); |
Hi,
How can i make an exec command with the interactive mode ??
I'm looking for a way to do
docker exec -it test /bin/bash
with docker api.Thanks for helping.
The text was updated successfully, but these errors were encountered: