Fix: the input device is not a TTY – Docker

Whenever I try to execute a command inside the Docker container with Jenkins, the following error appears:

the input device is not a TTY

Solution:

Instead of using the following in your Jenkinsfile or Jenkins Pipeline Library:

docker exec -it

Use the following instead:

docker exec --tty

The --tty tells docker to configure the tty, which won’t work if you don’t have a tty and try to attach to the container ( that is the default behaviour when you don’t detach -d the container ).


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *


Keep up, get in touch.

Follow

Instagram / Facebook

Designed with WordPress