I have a game server that I'm running in a docker image. If you send 'status' to the server stdin it will send the status of the server to it's stdout. I'm trying to find a way to send 'status' to the server from outside of docker. I want to send the 'status' command anytime I want to get an update from the game server. Ideally I would love to use either docker-python sdk or Python on whales but if I have to do it manually via the shell I'm ok with that too. I'm hoping not to have to modify the docker image because it's provided by the game manufacturer
I've looked into attach_socket but I believe that only sends stdout and stderr and does not provide an interface for sending to stdin.
I've also looked into this approach:Sending command to minecraft server running in docker
but since I'm wanting to do this using python the sending of ctrl-c when I'm finished is a bit hacky. I'm hoping there is a cleaner way.
I'm leaning toward this approach:https://serverfault.com/questions/885765/how-to-send-text-to-stdin-of-docker-containerbut it still feels a little hacky to me and it's a Linux only solution where I would like my project work on Windows and Linux