2023-05-04 07:11:11 +00:00
|
|
|
<?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 }');
|
2023-05-24 13:25:08 +00:00
|
|
|
$activity = remote_process([
|
2023-05-04 07:11:11 +00:00
|
|
|
"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"
|
2023-05-25 13:48:26 +00:00
|
|
|
], $server);
|
2023-05-04 07:11:11 +00:00
|
|
|
|
|
|
|
return $activity;
|
|
|
|
}
|
|
|
|
}
|