0

I'm trying to potentially ask for some input when running my container via docker run. This is a container based on Ubuntu running via docker. This works fine with -i -t but doesn't work with just -t. I can do without the input; I just need to know if that's the case and continue on "unattended" with some defaults/assumptions. Ideally, if I can't acquire input, I wouldn't prompt at all and would just continue on. How to determine that is what I'm trying to figure out.

I'm trying to identify the difference from the bash script (trying to detect the presence/absence of -i) but I haven't found a way to do so. I have found some ways to determine other things (like no switches/interactivity at all) but so far -t and -t -i look the same, but of course don't operate the same.

Josh
  • 6,944
  • 8
  • 41
  • 64
  • Does this answer your question? [How to detect fully interactive shell in bash from docker?](https://stackoverflow.com/questions/31281522/how-to-detect-fully-interactive-shell-in-bash-from-docker) – CollinD Jun 18 '23 at 00:49
  • Can you just not prompt at all, regardless of the container configuration? For example, expect settings to come from environment variables or command-line options? – David Maze Jun 18 '23 at 00:59
  • @CollinD Unfortunately both `$-` and `-t` return the same things in both `-i -t` and `-t` scenarios. `$-` returns `hB` in all cases for me, actually (never `i`), and `-t 0/1/2` is true for all FDs in both scenarios... – Josh Jun 18 '23 at 01:34
  • Gotcha, wasn't sure if the discussion further down in that thread was helpful or not. – CollinD Jun 18 '23 at 02:31

0 Answers0