settings->delete_unused_volumes) { $commands[] = 'docker volume prune -af'; } if ($server->settings->delete_unused_networks) { $commands[] = 'docker network prune -f'; } $cleanupLog = []; foreach ($commands as $command) { $commandOutput = instant_remote_process([$command], $server, false); if ($commandOutput !== null) { $cleanupLog[] = [ 'command' => $command, 'output' => $commandOutput, ]; } } return $cleanupLog; } }