Answer the question
In order to leave comments, you need to log in
Process manipulation in a Docker container. Or how to get the process console?
There is a docker container with a java console application. When running without docker, I get the entire log in the console and the ability to write commands there (STDIN). If the docker (docker-compose) copes with the display of logs with a bang, then something not very pleasant is already happening with the input of commands. When I run the `docker-compose up` command, of course, I see the entire log, but I can’t send the command to the application (which is logical). This is all complicated by the fact that it is necessary to provide an opportunity for different people (via ssh, for example) to access the stdin / out / err of the application. I tried to do it through `docker attach ...` - I got a void (because even keystrokes after Ctrl + C were immediately "thrown" to me in the local terminal).
Offhand, I remembered only one thing: screen. "Then I will have a console for each via `docker-compose exec app screen -x app`" - I thought. Without hesitation, I started writing a script. But on the first test, I got "Must be connected to a terminal.". Googling, I did not find a clear solution to my problem.
As a result: I have a console application, the console from which I need to share with other people (via ssh, for example).
Something like `docker exec -it app get-app-console` or its equivalent `docker-compose exec app get-app-console` would be ideal
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question