-
-
Notifications
You must be signed in to change notification settings - Fork 483
Open
Description
Hey there, I am trying to connect to a running container using attach. However when I use stdin: true it hangs in this line.
This is my code:
const Docker = require("dockerode");
const docker = new Docker({socketPath: '/var/run/docker.sock'});
const container = docker.getContainer('56cd62bc09ba8e46730f681bfd4cd08b741a6b98db9d676fb6af06c90ceb24b9')
const stream = await container.attach({
stdin: true,
stdout: true,
stderr: true,
stream: true,
})
stream.pipe(process.stdout)
setInterval(() => {
stream.write("velocity info\n")
}, 3000)I started the container using the following command
docker run -itd --rm --network host -v ... azul/zulu-openjdk-alpine:21-jre-headless ./start.shUsing docker attach <container_id> works just fine for in- and output. However the code gets stuck at container.attach when using stdin: true. With only stdout and stderr it works fine. But I also need the send input.
MoretzAcc and hal-shin
Metadata
Metadata
Assignees
Labels
No labels