I have a Dockerfile that builds an image containing a custom console application:
FROM ubuntu:bionic
# Some non-relevant steps...
CMD bin/my-console-app
my-console-app
is a simple console app that, while it runs, it normally gives you the possibility of inserting commands.
For example
./my-console-app
my-console> some-command
Some result
my-console> some-other-command
Some other result
if I run the container that I've build using the above Dockerfile using -d
, everything is fine:
docker run --name my-app --network host -d myapp
using the network I can see that the console app is correctly running.
However if I run it without -d
, like:
docker run --name my-app --network host myapp
then my terminal will go crazy, like someone is constantly pressing ENTER:
my-console>
my-console>
my-console>
my-console>
my-console>
my-console>
my-console>
my-console>
...
and this goes on forever. I cannot insert any command to my console app.
Why is that happening? What should I do to prevent this?