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 ).

Speak with an expert on our team to discuss Cloud solutions tailored to your business.

You’ll receive free recommendations tailored to your business.