fix(docker): replace deprecated --time flag with -t for full compatibility across Docker versions (#6807)
This commit is contained in:
commit
25a96ad662
8 changed files with 8 additions and 8 deletions
|
|
@ -39,7 +39,7 @@ public function handle(Application $application, bool $previewDeployments = fals
|
||||||
|
|
||||||
foreach ($containersToStop as $containerName) {
|
foreach ($containersToStop as $containerName) {
|
||||||
instant_remote_process(command: [
|
instant_remote_process(command: [
|
||||||
"docker stop --time=30 $containerName",
|
"docker stop -t 30 $containerName",
|
||||||
"docker rm -f $containerName",
|
"docker rm -f $containerName",
|
||||||
], server: $server, throwError: false);
|
], server: $server, throwError: false);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ public function handle(Application $application, Server $server)
|
||||||
if ($containerName) {
|
if ($containerName) {
|
||||||
instant_remote_process(
|
instant_remote_process(
|
||||||
[
|
[
|
||||||
"docker stop --time=30 $containerName",
|
"docker stop -t 30 $containerName",
|
||||||
"docker rm -f $containerName",
|
"docker rm -f $containerName",
|
||||||
],
|
],
|
||||||
$server
|
$server
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ private function stopContainer($database, string $containerName, int $timeout =
|
||||||
{
|
{
|
||||||
$server = $database->destination->server;
|
$server = $database->destination->server;
|
||||||
instant_remote_process(command: [
|
instant_remote_process(command: [
|
||||||
"docker stop --time=$timeout $containerName",
|
"docker stop -t $timeout $containerName",
|
||||||
"docker rm -f $containerName",
|
"docker rm -f $containerName",
|
||||||
], server: $server, throwError: false);
|
], server: $server, throwError: false);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ public function handle(Server $server, bool $forceStop = true, int $timeout = 30
|
||||||
}
|
}
|
||||||
|
|
||||||
instant_remote_process(command: [
|
instant_remote_process(command: [
|
||||||
"docker stop --time=$timeout $containerName 2>/dev/null || true",
|
"docker stop -t=$timeout $containerName 2>/dev/null || true",
|
||||||
"docker rm -f $containerName 2>/dev/null || true",
|
"docker rm -f $containerName 2>/dev/null || true",
|
||||||
'# Wait for container to be fully removed',
|
'# Wait for container to be fully removed',
|
||||||
'for i in {1..10}; do',
|
'for i in {1..10}; do',
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ private function stopContainersInParallel(array $containersToStop, Server $serve
|
||||||
$timeout = count($containersToStop) > 5 ? 10 : 30;
|
$timeout = count($containersToStop) > 5 ? 10 : 30;
|
||||||
$commands = [];
|
$commands = [];
|
||||||
$containerList = implode(' ', $containersToStop);
|
$containerList = implode(' ', $containersToStop);
|
||||||
$commands[] = "docker stop --time=$timeout $containerList";
|
$commands[] = "docker stop -t $timeout $containerList";
|
||||||
$commands[] = "docker rm -f $containerList";
|
$commands[] = "docker rm -f $containerList";
|
||||||
instant_remote_process(
|
instant_remote_process(
|
||||||
command: $commands,
|
command: $commands,
|
||||||
|
|
|
||||||
|
|
@ -3143,7 +3143,7 @@ private function graceful_shutdown_container(string $containerName)
|
||||||
try {
|
try {
|
||||||
$timeout = isDev() ? 1 : 30;
|
$timeout = isDev() ? 1 : 30;
|
||||||
$this->execute_remote_command(
|
$this->execute_remote_command(
|
||||||
["docker stop --time=$timeout $containerName", 'hidden' => true, 'ignore_errors' => true],
|
["docker stop -t $timeout $containerName", 'hidden' => true, 'ignore_errors' => true],
|
||||||
["docker rm -f $containerName", 'hidden' => true, 'ignore_errors' => true]
|
["docker rm -f $containerName", 'hidden' => true, 'ignore_errors' => true]
|
||||||
);
|
);
|
||||||
} catch (Exception $error) {
|
} catch (Exception $error) {
|
||||||
|
|
|
||||||
|
|
@ -191,7 +191,7 @@ private function stopPreviewContainers(array $containers, $server, int $timeout
|
||||||
|
|
||||||
$containerList = implode(' ', array_map('escapeshellarg', $containerNames));
|
$containerList = implode(' ', array_map('escapeshellarg', $containerNames));
|
||||||
$commands = [
|
$commands = [
|
||||||
"docker stop --time=$timeout $containerList",
|
"docker stop -t $timeout $containerList",
|
||||||
"docker rm -f $containerList",
|
"docker rm -f $containerList",
|
||||||
];
|
];
|
||||||
instant_remote_process(
|
instant_remote_process(
|
||||||
|
|
|
||||||
|
|
@ -278,7 +278,7 @@ private function stopContainers(array $containers, $server)
|
||||||
|
|
||||||
foreach ($containersToStop as $containerName) {
|
foreach ($containersToStop as $containerName) {
|
||||||
instant_remote_process(command: [
|
instant_remote_process(command: [
|
||||||
"docker stop --time=30 $containerName",
|
"docker stop -t 30 $containerName",
|
||||||
"docker rm -f $containerName",
|
"docker rm -f $containerName",
|
||||||
], server: $server, throwError: false);
|
], server: $server, throwError: false);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue