Skip to content

Instantly share code, notes, and snippets.

@aanand
Last active December 24, 2015 11:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aanand/6795151 to your computer and use it in GitHub Desktop.
Save aanand/6795151 to your computer and use it in GitHub Desktop.
Discrepancy in behaviour of docker run-with-immediate-attach vs run-and-then-attach
# Normal run, without -d.
# Container prompt appears immediately; after exiting, system prompt appears on new line.
$ docker run -i -t ubuntu bash
root@0b3fa3041e3f:/# exit
exit
$
# Now run with -d and *then* attach.
# Container prompt doesn't appear until I hit Enter; after exiting, system prompt appears on same line.
$ docker run -i -t -d ubuntu bash
9c1bcb6ed547
$ docker attach 9c1bcb6ed547
<PRESS ENTER>
root@9c1bcb6ed547:/# exit
exit$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment