diff --git a/Dockerfile b/Dockerfile index 9b0d9ad..b1cf9c1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,8 @@ FROM sahrea/webserver WORKDIR /var/www/html +RUN touch /var/run/docker.sock && chmod 777 /var/run/docker.sock + COPY index.php /var/www/html/index.php COPY style/ /var/www/html/style/ diff --git a/classen/docker.php b/classen/docker.php index 4651353..3054b32 100644 --- a/classen/docker.php +++ b/classen/docker.php @@ -46,5 +46,9 @@ $rawOutput = curl_exec($this->CurlClient); } + + public function getError($container){ + return curl_strerror(curl_errno($this->CurlClient)); + } } ?> diff --git a/pages/dashboard.php b/pages/dashboard.php index 65f7d5a..8bf2ab8 100644 --- a/pages/dashboard.php +++ b/pages/dashboard.php @@ -9,13 +9,14 @@ if(isset($_SESSION['LOGIN'])) $allContainers = $dockerClient->getAllContainers(); $container = NULL; + echo ("/".$_SESSION['CONATINER']); + foreach($allContainers as $thisContainer) { - echo $thisContainer['id']." == ".$thisContainer['Names'][0]."\n"; + echo $thisContainer['Id']." == ".$thisContainer['Names'][0]."\n"; - if($thisContainer['id'] == $_SESSION['CONATINER'] || $thisContainer['Names'][0] == ("/".$_SESSION['CONATINER'])) + if($thisContainer['Id'] == $_SESSION['CONATINER'] || $thisContainer['Names'][0] == ("/".$_SESSION['CONATINER'])) $container = $thisContainer; - } if($container == NULL)