Commit 5c5403e7 authored by odlai's avatar odlai

add a new func create

parent 4d19375e
......@@ -12,7 +12,7 @@ class DockerController extends Controller
{
//
private $docker_ip="http://192.168.42.203:2375";
private $docker_ip="http://192.168.43.203:2375";
public function init()
{
......@@ -40,21 +40,20 @@ class DockerController extends Controller
$client = new \GuzzleHttp\Client();
$res = $client->POST($this->docker_ip."/containers/".$container_id."/".$status);
// $res = $client->get('http://192.168.5.194:2375/containers/json');
// $RRR=$res->getBody();
// $contents = (string) $res->getBody();
// $meta = stream_get_meta_data($RRR);
return redirect()->back();
// $response = json_decode($res->getBody()->__toString(), true);
// echo ($response[0]['Status']);
// $results = json_decode((string)$res->getBody()->getContents(),true);
// // echo $results;
// // dd($res);
// foreach($results as $R){
// echo $R;
}
public function create(Request $request){
$rr=$request->input('origin_stream');
$dd=$request->input('identify_module');
// return($rr.$dd);
$client = new \GuzzleHttp\Client();
$res = $client->POST($this->docker_ip."/images/create?",[
'fromImage' =>'busybox',
'tag' =>'latest'
]);
$response = json_decode($res->getBody()->__toString(), true);
return $response;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment