html tool

2020年12月22日星期二

the input device is not a tty docker

 参考:https://stackoverflow.com/questions/43099116/error-the-input-device-is-not-a-tty

问题:

sshpass p '123' ssh root@192.168.100.169 "docker exec -it sht ls -all /root/work/ngtdp/hotfix"|grep hotfix

the input device is not a tty

解决:

Remove the -it from your cli to make it non interactive and remove the TTY. If you don't need either, e.g. running your command inside of a Jenkins or cron script, you should do this.

Or you can change it to -i if you have input piped into the docker command that doesn't come from a TTY. If you have something like xyz | docker ... or docker ... <input in your command line, do this.


[popexizhi:

原始的命令是 

docker exec -it sht /bin/bash

这里的/bin/bash是可以用的其他用的方式替代的

]

没有评论:

发表评论