Understanding Docker Run Arguments: -I, -T, and --Attach
When working with Docker, you often use various command-line arguments to customize the behavior of containers when they are launched. Three commonly used arguments are -i
, -t
, and --attach
. These arguments are often used together, and they serve different purposes in controlling how your container interacts with the terminal and user input.
-i
- Interactive Mode
The -i
flag stands for “interactive.” When you include this flag in your docker run
command, it tells Docker to keep STDIN (standard input) open, allowing you to interact with the container’s command or application. Here’s what it means in more detail: