dockerode
dockerode copied to clipboard
Sending User Input via Attach or Other
I already have a container running which as a Minecraft server instance running in it. I'm trying to attach to the container and send a server command to the console without using RCON. When I use the normal docker attach {id} command it allows me to send messages like normal but when I do it with dockerode I can't. Am I missing settings or something?
Here is my current code of how I'm trying to attach to the docker. The container variable is just a docker.getContainer("id"). Also, when I had it in the callback way, there was no errors from the "err" var. Any help will be appreciated!
let stream = await container.attach({
stream: true,
stdin: true,
stdout: true,
stderr: true,
})
stream.write("help\n")
stream.end()