This commit is contained in:
Andras Bacsai
2023-05-02 15:20:45 +02:00
parent 53e2960ffd
commit 23cea9a130
5 changed files with 28 additions and 11 deletions

View File

@@ -23,6 +23,12 @@ class Form extends Component
{
$this->server = Server::find($this->server_id);
}
public function installDocker()
{
$config = base64_encode('{ "live-restore": true }');
runRemoteCommandSync($this->server, ["mkdir -p /etc/docker/", "touch /etc/docker/daemon.json", "echo '{$config}' | base64 -d > /etc/docker/daemon.json"]);
runRemoteCommandSync($this->server, ['sh -c "$(curl --silent -fsSL https://get.docker.com)"']);
}
public function checkConnection()
{
$this->uptime = runRemoteCommandSync($this->server, ['uptime']);