Jae's Blog

2024-11-11

Sending commands to a Docker Compose Resonite headless

Filed under: DevOps,Tutorials — jae @ 03:26

After searching for a bit, I found a way to send commands to a Resonite headless within Docker programmatically without having to run docker compose attach <container> and having to manually detach.

You will need the software socat installed on the host machine, given most of my machines are running Debian, this can be done via apt install socat.

Now, you can use:

echo 'worlds' | socat EXEC:"docker attach $(docker compose ps -q reso-headless)",pty STDINCode language: Bash (bash)

In this command, replace:

  • worlds by the command you want
  • reso-headless by the defined name of your headless container

Alternatively, you can just specify the container name directly instead of doing $(docker compose ps -q reso-headless).

Addendum:

For this to work, you will have to make sure your container is defined with:

    tty: true
    stdin_open: true
Code language: YAML (yaml)

in the Compose file.

No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

CC BY-SA 4.0 2012-2025 Jae Lo Presti