mirror of
https://github.com/unraid/webgui.git
synced 2026-04-27 05:19:44 -05:00
Docker code cleanup/refactor and bug fixes:
- Dont start container after update if it was in a stopped state before the update - Dont try to stop a container if it is not running (was causing warnings to be logged) - Reduced script tag generation for docker pull operations - Correctly clean up old orphan images after updating a container (was broken before) - Eliminated race condition when deleting both container and image - Switched to use SweetAlert instead of jQuery UI dialogs for prompts and alerts
This commit is contained in:
@@ -12,10 +12,10 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
exec("pgrep docker",$pid);
|
||||
if (count($pid)==1) exit(0);
|
||||
exec("pgrep docker", $pid);
|
||||
if (count($pid) == 1) exit(0);
|
||||
|
||||
require_once("/usr/local/emhttp/plugins/dynamix.docker.manager/include/DockerClient.php");
|
||||
require_once '/usr/local/emhttp/plugins/dynamix.docker.manager/include/DockerClient.php';
|
||||
$DockerClient = new DockerClient();
|
||||
$DockerTemplates = new DockerTemplates();
|
||||
|
||||
@@ -32,15 +32,14 @@ if (!isset($check)) {
|
||||
$DockerTemplates->getAllInfo(true);
|
||||
echo " Done.";
|
||||
} else {
|
||||
require_once("/usr/local/emhttp/webGui/include/Wrappers.php");
|
||||
require_once '/usr/local/emhttp/webGui/include/Wrappers.php';
|
||||
$notify = "/usr/local/emhttp/webGui/scripts/notify";
|
||||
$unraid = parse_plugin_cfg("dynamix",true);
|
||||
$server = strtoupper($var['NAME']);
|
||||
$output = $unraid['notify']['docker_notify'];
|
||||
|
||||
$list = $DockerClient->getDockerContainers();
|
||||
$info = $DockerTemplates->getAllInfo(true);
|
||||
foreach ($list as $ct) {
|
||||
foreach ($DockerClient->getDockerContainers() as $ct) {
|
||||
$name = $ct['Name'];
|
||||
$image = $ct['Image'];
|
||||
if ($info[$name]['updated'] == "false") {
|
||||
|
||||
Reference in New Issue
Block a user