I have a python app with a shell-like interface that accepts commands via stdin. I’m trying to figure out how to setup docker-compose / balena-engine such that I can attach to the container and use the shell.
My python app uses
input('> ') to wait for stdin. It’s working when run directly, outside of balena.
docker-compose.yml config I’ve added
stdin_open: true and
Then I ssh into the host container and attach with
balena-engine attach core. This appears to attach correctly to the app but typing commands into the prompt (actually the
> prompt doesn’t appear) has no effect… i.e. the input never reaches the program.
I can make it work by running
balena-engine run -ti local_image_core but then it’s running independently of docker-compose and I don’t think that’s what I want.
How can I connect to an interactive shell like this?
Any help would be much appreciated!