I did some googling and have had no luck finding a case where I\'d run docker run -i some_image
rather than docker run -it some_image
.
If
Since -i
keeps STDIN open even if not attached, it allows for composition (piping).
For example:
docker run ubuntu printf "line1\nline2\n" | docker run -i ubuntu grep line2 | docker run -i ubuntu sed 's/line2/line3/g'
(Source: issue 14221)
Or:
$ echo hello | docker run -i busybox cat
hello
(Source: issue 12401)
Now imagine this not in front of a keyboard and being used in a script where you can actually write to the processes stdin through something better than a shell
|
: example integration-cli/docker_cli_attach_test.go