add interactive and tty to dockerfile, closes #1870

Bases on closed pr #1873, but includes the suggested changes, including tests and documentation updates.