Update update_container

This commit is contained in:
Squidly271
2024-01-25 19:27:37 -05:00
committed by GitHub
parent 1155d09dd1
commit f57c9b60d5

View File

@@ -178,11 +178,16 @@ foreach (explode('*',rawurldecode($argv[1])) as $value) {
$startContainer = false;
if (!empty($oldContainerInfo) && !empty($oldContainerInfo['State']) && !empty($oldContainerInfo['State']['Running'])) {
// since container was already running, put it back it to a running state after update
$cmd = str_replace('/docker create ', '/docker run -d ', $cmd);
$startContainer = true;
// attempt graceful stop of container first
stopContainer_nchan($Name);
}
if ( ($argv[2]??null) == "ca_docker_run_override" )
$startContainer = true;
if ( $startContainer )
$cmd = str_replace('/docker create ', '/docker run -d ', $cmd);
// force kill container if still running after 10 seconds
if (empty($_GET['communityApplications'])) removeContainer_nchan($Name);
execCommand_nchan($cmd);