Menu="Docker:1" Title="Docker Containers" Cond="(pgrep('docker')!==false)" Markdown="false" ---
getDockerContainers(); if (!$all_containers) { $all_containers = []; echo ""; } $info = $DockerTemplates->getAllInfo(); $contextMenus = []; $IP = $eth0["IPADDR:0"]; foreach ($all_containers as $ct) { $name = $ct["Name"]; $is_autostart = ($info[$name]['autostart']) ? 'true' : 'false'; $updateStatus = $info[$name]['updated']; $updateStatus = ($updateStatus == "true" || $updateStatus == "undef") ? 'true' : 'false'; $running = ($ct['Running']) ? 'true' : 'false'; $webGuiUrl = $info[$name]['url']; $contextMenus[] = sprintf("addDockerContainerContext('%s', '%s', '%s', %s, %s, %s, '%s', '%s');", addslashes($ct['Name']), addslashes($ct['ImageId']), addslashes($info[$name]['template']), $running, $updateStatus, $is_autostart, addslashes($webGuiUrl), $ct["Id"]); $shape = ($ct["Running"]) ? "play" : "square"; $status = ($ct["Running"]) ? "started" : "stopped"; $Icon = $info[$name]['icon']; if (!$Icon) { $Icon = "/plugins/dynamix.docker.manager/images/question.png"; } $ports = []; foreach ($ct['Ports'] as $p) { if (strlen($p['PublicPort'])) { $ipAddr = sprintf("%s:%s", $IP, $p['PublicPort']); $outFormat = sprintf('%s/%s %s', $ipAddr, $p['PrivatePort'], $p['Type'], htmlspecialchars($ipAddr)); } else { $outFormat = sprintf("%s/%s", $p['PrivatePort'], $p['Type']); } $ports[] = $outFormat; } $paths = []; if (count($ct['Volumes'])){ foreach ($ct['Volumes'] as $value) { if (preg_match('/localtime/', $value) == true) continue; list($host_path, $container_path, $access_mode) = explode(":", $value); $tip = 'Container volume \'' . $container_path . '\' has ' . ($access_mode == 'ro' ? 'read-only' : 'read-write') . ' access to Host path \'' . $host_path . '\''; $paths[] = sprintf('%s %s', urlencode($host_path), htmlspecialchars($tip), htmlspecialchars($container_path), ($access_mode == 'ro' ? 'long-arrow-left' : 'arrows-h'), htmlspecialchars($host_path)); } } ?> getDockerImages() as $image) { if (count($image['usedBy'])) { continue; } $contextMenus[] = sprintf("addDockerImageContext('%s', '%s');", $image['Id'], implode(', ', $image['Tags'])); ?>
  Application Version Port Mappings (App to Host) Volume Mappings (App to Host) Autostart Log
No Docker Containers Installed
"; ?>
Container ID:
By:
update ready"; } else if ($updateStatus == "true") { echo " up-to-date"; echo ""; } else { echo " not available"; echo ""; } ?> ", $ports); ?> ", $paths); ?> >
Created
"; ?>
(orphan image)
Image ID:
", $image['Tags'])?>
       
Created