docker build -t requiretty:centos66 -f Dockerfile .
docker run -it requiretty:centos66
Depth: 1
Currently logged in as: test
Current TTY: /4
Elevated: false
Attempting Elevation to root
sudo: sorry, you must have a tty to run sudo
Attempting Alternate Elevation to root
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
[sudo] password for test: Depth: 2
Currently logged in as: root
Current TTY: not a tty
Elevated: true
I am root
I am test
S:\GitHub\docker\requiretty>