docker exec -it
command returns following error "cannot enable tty mode on non tty input"
level="fatal" msg="cannot enable tty mode on non tty input"
I am running docker(1.4.1) on centos box 6.6.
I am trying to execute the following command
docker exec -it containerName /bin/bash
but I am getting following error
level="fatal" msg="cannot enable tty mode on non tty input"
If you're on Windows and using docker-machine and you're using GIT Bash or Cygwin, to "get inside" a running container you'll need to do the following:
docker-machine ssh default
to ssh into the virtual machine (Virtualbox most likely)docker exec -it <container> bash
to get into the container.EDIT:
I've recently discovered that if you use Windows PowerShell you can docker exec directly into the container, with Cygwin or Git Bash you can use
winpty docker exec -it <container> bash
and skip thedocker-machine ssh
step above.docker exec
runs a new command in an already-running container. It is not the way to start a new container -- usedocker run
for that.That may be the cause for the "non tty input" error. Or it could be where you are running docker. Is it a true terminal? That is, is a full tty session available? You might want to check if you are in an interactive session with
from https://unix.stackexchange.com/questions/26676/how-to-check-if-a-shell-is-login-interactive-batch