Menu="Docker:1" Title="Docker Containers" Cond="(pgrep('docker')!==false)" Markdown="false" ---
getDockerContainers(); if ( ! $all_containers) { $all_containers = array(); echo ""; } $info = $DockerTemplates->getAllInfo(); $contextMenus = array(); $IP = $var["IPADDR"]; foreach($all_containers as $ct){ $name = $ct["Name"]; $is_autostart = ( $info[$name]['autostart'] ) ? 'true' : 'false'; $updateStatus = $info[$name]['updated']; $updateStatus = ($updateStatus == "true" or $updateStatus == "undef" ) ? 'true' : 'false'; $running = ($ct['Running']) ? 'true' : 'false'; $webGuiUrl = $info[$name]['url']; $contextMenus[] = sprintf("addDockerContainerContext('%s', '%s', '%s', %s, %s, %s, '%s');", addslashes($ct['Name']), addslashes($ct['ImageId']), addslashes($info[$name]['template']), $running, $updateStatus, $is_autostart, addslashes($webGuiUrl)); $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 = array(); 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 = array(); 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(); if ( ! $all_images) { $all_images = array(); } foreach($all_images as $image){ if (count($image['usedBy'])) { continue; } $contextMenus[] = sprintf("addDockerImageContext('%s', '%s');", $image['Id'], implode(', ', $image['Tags'])); ?>
  Application Author / Repo Version Port Mappings (App to Host) Volume Mappings (App to Host) Autostart Log
No Docker Containers Installed
"; ?>
Container ID:
%s", htmlspecialchars($Registry), htmlspecialchars($ct['Image']) ); } else { echo htmlspecialchars($ct['Image']); } ?> 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