lasthourcloud/app/Actions/Server/InstallDocker.php
Andras Bacsai ac976d0f3a fixes
2023-05-04 09:11:11 +02:00

25 lines
657 B
PHP

<?php
namespace App\Actions\Server;
use App\Enums\ActivityTypes;
use App\Models\Server;
class InstallDocker
{
public function __invoke(Server $server)
{
$config = base64_encode('{ "live-restore": true }');
$activity = remoteProcess([
"echo Installing Docker...",
"curl https://releases.rancher.com/install-docker/23.0.sh | sh",
"echo Configuring Docker...",
"echo '{$config}' | base64 -d > /etc/docker/daemon.json",
"echo Restarting Docker...",
"systemctl restart docker"
], $server, ActivityTypes::INLINE->value);
return $activity;
}
}