Docker Community Forums

Share and learn in the Docker community.

How to stdin in docker execstart in docker-php api

 $remoteSocket ='';
 $ssl = false;
// Connect to Docker
$client = DockerClientFactory::create([
'remote_socket' => $remoteSocket,
'ssl' => $ssl
$docker = Docker::create($client);
$config = new ContainersCreatePostBody();
$creation = $docker->containerCreate($config);
$execConfig = new ContainersIdExecPostBody();
$execid = $docker->containerExec($creation->getId(),$execConfig)->getId();
$execStartConfig = new ExecIdStartPostBody();
// Execute the command
$stream = $docker->execStart($execid,$execStartConfig);
// To see the output stream of the 'exec' command
$stdoutText = "";
$stderrText = "";
$stream->onStdout(function ($stdout) use (&$stdoutText) {
echo $stdout;
$stream->onStderr(function ($stderr) use (&$stderrText) {
print_r("err: ".$stderr."\n");

pleaaaaaaaaaaase HELP MEEEEE .
its my code . in this example i want to interact with bash . i get output from container but i can’t sent anything to container. i think i should do something with Tty !!!
thanks in advance.


anybody does not help me?