Skip to content
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

Sending User Input via Attach or Other #769

Open
RimuruOtter opened this issue Jun 28, 2024 · 0 comments
Open

Sending User Input via Attach or Other #769

RimuruOtter opened this issue Jun 28, 2024 · 0 comments

Comments

@RimuruOtter
Copy link

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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant