0

I want login with docker through php.

I have tried with below command in php.

$content = system('sudo docker exec -it 8a3d7166d18d bash ;', $ret);

But it is giving below error:

the input device is not a TTY

It works perfectly through terminal in ubuntu. But not working that file in browser.

Jigar Pancholi
  • 1,209
  • 1
  • 8
  • 25
  • According to https://stackoverflow.com/questions/43099116/error-the-input-device-is-not-a-tty, remove the option 't'. – GoA Oz Jul 30 '18 at 09:19
  • Not working without ```t```. – Jigar Pancholi Jul 30 '18 at 10:20
  • Euh no my bad the "-it" and add "-d", But I don't understand why are you using "docker exec bash" with php script? We can do that but the you will get nothing because without/with "-it" "-t" "-i" you will only run bash in your container without OUTPOUT and/or TTY. https://docs.docker.com/engine/reference/commandline/exec/#run-docker-exec-on-a-running-container – GoA Oz Jul 31 '18 at 08:20

0 Answers0