This is obviously a newbie question. The docker run man page is not clear about this. This is what it says about foreground mode, which I understand to be the same as attached mode:
In foreground mode (the default when -d is not specified), docker run can start the process in the container and attach the console to the process’s standard input, output, and standard error. It can even pretend to be a TTY (this is what most command line executables expect) and pass along signals.
My question: In foreground mode, it can do various things, but options like -i and -t are required. What if I start a container without providing a TTY (-t) and without keeping stdin open (-i)?
In other words: When I start a container started like this, without any option:
docker run MY-IMAGE
I get the host’s login prompt, as expected. But how does this differ from:
docker run -d MY-IMAGE