remove docker api

This commit is contained in:
Christopher 2020-10-23 12:14:23 +02:00
parent 016930a94d
commit a55a02095b
2 changed files with 11 additions and 9 deletions

View File

@ -2,8 +2,6 @@ FROM sahrea/webserver
WORKDIR /var/www/html
RUN composer require docker-php/docker-php
COPY index.php /var/www/html/index.php
COPY style/ /var/www/html/style/

View File

@ -1,16 +1,20 @@
<?php
class Docker
{
private $CurlClient = null;
private $CurlClient = NULL;
function __construct() {
$this->$CurlClient = curl_init();
curl_setopt($this->$CurlClient, CURLOPT_UNIX_SOCKET_PATH, "/var/run/docker.sock");
function __construct(){
$this->CurlClient = curl_init();
curl_setopt($this->CurlClient, CURLOPT_UNIX_SOCKET_PATH, "/var/run/docker.sock");
curl_setopt($this->CurlClient, CURLOPT_BUFFERSIZE, 256);
curl_setopt($this->CurlClient, CURLOPT_TIMEOUT, 1000000);
}
public function getAllContainers(){
curl_setopt($this->$CurlClient, CURLOPT_URL, "http:/v1.24/containers/json");
$jsonRAWData = curl_exec($this->$CurlClient);
curl_setopt($this->CurlClient, CURLOPT_URL, "http:/v1.24/containers/json");
$jsonRAWData = curl_exec($this->CurlClient);
print_r($jsonRAWData);
return json_decode($jsonRAWData, TRUE);
}
@ -34,4 +38,4 @@
}
}
?>
?>