Title: interact with container bash with execStart · Issue #342 · docker-php/docker-php · GitHub
Open Graph Title: interact with container bash with execStart · Issue #342 · docker-php/docker-php
X Title: interact with container bash with execStart · Issue #342 · docker-php/docker-php
Description: I want to interact with bash. I get output from container but I can't send anything to container. i want to write container stdin but i cant . It is very vital this issue. please answer quickly. I think I should do something with Tty. my...
Open Graph Description: I want to interact with bash. I get output from container but I can't send anything to container. i want to write container stdin but i cant . It is very vital this issue. please answer quickly. I ...
X Description: I want to interact with bash. I get output from container but I can't send anything to container. i want to write container stdin but i cant . It is very vital this issue. please answer quickly...
Opengraph URL: https://github.com/docker-php/docker-php/issues/342
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"interact with container bash with execStart ","articleBody":"**I want to interact with bash. I get output from container but I can't send anything to container. i want to write container stdin but i cant .\r\nIt is very vital this issue. please answer quickly.\r\nI think I should do something with Tty.**\r\n\r\n_**my snippet of code is below:**_\r\n\r\n $remoteSocket ='192.168.85.34:2375';\r\n $ssl = false;\r\n // Connect to Docker\r\n $client = DockerClientFactory::create([\r\n 'remote_socket' =\u003e $remoteSocket,\r\n 'ssl' =\u003e $ssl\r\n ]);\r\n $docker = Docker::create($client);\r\n\r\n $config = new ContainersCreatePostBody();\r\n $config-\u003esetTty(true);\r\n $config-\u003esetOpenStdin(true);\r\n $config-\u003esetAttachStderr(true);\r\n $config-\u003esetAttachStdout(true);\r\n $config-\u003esetAttachStdin(true);\r\n $config-\u003esetStdinOnce(false);\r\n $config-\u003esetImage(\"test:2\"); \r\n\r\n $creation = $docker-\u003econtainerCreate($config);\r\n $docker-\u003econtainerStart($creation-\u003egetId());\r\n \r\n $execConfig = new ContainersIdExecPostBody();\r\n $execConfig-\u003esetTty(true);\r\n $execConfig-\u003esetAttachStdout(true);\r\n $execConfig-\u003esetAttachStderr(true);\r\n $execConfig-\u003esetAttachStdin(true);\r\n $execConfig-\u003esetCmd(['/bin/bash']);\r\n $execid = $docker-\u003econtainerExec($creation-\u003egetId(),$execConfig)-\u003egetId();\r\n\r\n $execStartConfig = new ExecIdStartPostBody();\r\n $execStartConfig-\u003esetDetach(false);\r\n // Execute the command\r\n\r\n $stream = $docker-\u003eexecStart($execid,$execStartConfig);\r\n\r\n \r\n $stream-\u003eonStdout(function ($stdout) {\r\n echo $stdout;\r\n });\r\n $stream-\u003eonStderr(function ($stderr) {\r\n print_r(\"err: \".$stderr.\"\\n\");\r\n });\r\n $stream-\u003ewait();\r\n\r\nThanks in advance.","author":{"url":"https://github.com/mohammadreza-soft74","@type":"Person","name":"mohammadreza-soft74"},"datePublished":"2018-12-06T06:09:55.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/342/docker-php/issues/342"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ef3e8953-ef75-6827-0033-ce244d78c172 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AB6A:E7822:C3FCD66:FD30BAE:6976C7D2 |
| html-safe-nonce | 5763abf7886a99959fb87c5e495ab3ca66a59cd20182f820bf0f2ad9a3b5d9e5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQjZBOkU3ODIyOkMzRkNENjY6RkQzMEJBRTo2OTc2QzdEMiIsInZpc2l0b3JfaWQiOiI2MzQ4MzU3MjQ0NjMwMjU1NTcwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f3911e9914676e29e2fef1cae5656bbe9c79c51d9f90e47181bdc888bb5d3196 |
| hovercard-subject-tag | issue:388070316 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/docker-php/docker-php/342/issue_layout |
| twitter:image | https://opengraph.githubassets.com/26ccf759391e91bc5c66d096a68c82daa3b992bfdc2d75ef145732400988498e/docker-php/docker-php/issues/342 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/26ccf759391e91bc5c66d096a68c82daa3b992bfdc2d75ef145732400988498e/docker-php/docker-php/issues/342 |
| og:image:alt | I want to interact with bash. I get output from container but I can't send anything to container. i want to write container stdin but i cant . It is very vital this issue. please answer quickly. I ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mohammadreza-soft74 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 032152924a283b83384255d9489e7b93b54ba01da8d380b05ecd3953b3212411 |
| turbo-cache-control | no-preview |
| go-import | github.com/docker-php/docker-php git https://github.com/docker-php/docker-php.git |
| octolytics-dimension-user_id | 16955543 |
| octolytics-dimension-user_login | docker-php |
| octolytics-dimension-repository_id | 15030753 |
| octolytics-dimension-repository_nwo | docker-php/docker-php |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 15030753 |
| octolytics-dimension-repository_network_root_nwo | docker-php/docker-php |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5b577f6be6482e336e3c30e8daefa30144947b17 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width