Error “The input device is not a TTY”

后端 未结 11 1206
野的像风
野的像风 2020-11-27 09:20

I am running the following command from my Jenkinsfile. However, I get the error \"The input device is not a TTY\".

docker run -v $PWD:         


        
相关标签:
11条回答
  • 2020-11-27 09:45

    winpty works as long as you don't specify volumes to be mounted such as ".:/mountpoint" or "${pwd}:/mountpoint"

    The best workaround I have found is to use the git-bash plugin inside Visual Code Studio and use the terminal to start and stop containers or docker-compose.

    0 讨论(0)
  • 2020-11-27 09:47

    For those who struggle with this error and git bash on Windows, just use PowerShell where -it works perfectly.

    0 讨论(0)
  • 2020-11-27 10:00

    It's not exactly what you are asking, but:

    The -T key would help people who are using docker-compose exec!

    docker-compose -f /srv/backend_bigdata/local.yml exec -T postgres backup
    
    0 讨论(0)
  • 2020-11-27 10:00

    I believe you need to be in a TTY for docker to be able to allocate a TTY (the -t option). Jenkins executes its jobs not in a TTY.

    Having said that, the script you are running within Jenkins you may also want to run locally. In that case it can be really convenient to have a TTY allocated so you can send signals like ctrl+c when running it locally.

    To fix this make your script optionally use the -t option, like so:

    test -t 1 && USE_TTY="-t" 
    docker run ${USE_TTY} ...
    
    0 讨论(0)
  • 2020-11-27 10:02

    if using windows, try with cmd , for me it works. check if docker is started.

    0 讨论(0)
提交回复
热议问题