mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-05-21 10:50:10 +00:00
@@ -137,6 +137,13 @@
|
||||
"read_only": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"tmpfs": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"pattern": "^/[a-z/]$"
|
||||
}
|
||||
},
|
||||
"volumes": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
|
||||
@@ -31,6 +31,7 @@ class Container {
|
||||
private array $backupVolumes;
|
||||
private array $nextcloudExecCommands;
|
||||
private bool $readOnlyRootFs;
|
||||
private array $tmpfs;
|
||||
private DockerActionManager $dockerActionManager;
|
||||
|
||||
public function __construct(
|
||||
@@ -52,6 +53,7 @@ class Container {
|
||||
array $backupVolumes,
|
||||
array $nextcloudExecCommands,
|
||||
bool $readOnlyRootFs,
|
||||
array $tmpfs,
|
||||
DockerActionManager $dockerActionManager
|
||||
) {
|
||||
$this->identifier = $identifier;
|
||||
@@ -72,6 +74,7 @@ class Container {
|
||||
$this->backupVolumes = $backupVolumes;
|
||||
$this->nextcloudExecCommands = $nextcloudExecCommands;
|
||||
$this->readOnlyRootFs = $readOnlyRootFs;
|
||||
$this->tmpfs = $tmpfs;
|
||||
$this->dockerActionManager = $dockerActionManager;
|
||||
}
|
||||
|
||||
@@ -111,6 +114,10 @@ class Container {
|
||||
return $this->secrets;
|
||||
}
|
||||
|
||||
public function GetTmpfs() : array {
|
||||
return $this->tmpfs;
|
||||
}
|
||||
|
||||
public function GetDevices() : array {
|
||||
return $this->devices;
|
||||
}
|
||||
|
||||
@@ -267,6 +267,11 @@ class ContainerDefinitionFetcher
|
||||
$readOnlyRootFs = $entry['read_only'];
|
||||
}
|
||||
|
||||
$tmpfs = [];
|
||||
if (isset($entry['tmpfs'])) {
|
||||
$tmpfs = $entry['tmpfs'];
|
||||
}
|
||||
|
||||
$containers[] = new Container(
|
||||
$entry['container_name'],
|
||||
$displayName,
|
||||
@@ -286,6 +291,7 @@ class ContainerDefinitionFetcher
|
||||
$backupVolumes,
|
||||
$nextcloudExecCommands,
|
||||
$readOnlyRootFs,
|
||||
$tmpfs,
|
||||
$this->container->get(DockerActionManager::class)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -430,6 +430,11 @@ class DockerActionManager
|
||||
$requestBody['HostConfig']['ShmSize'] = $shmSize;
|
||||
}
|
||||
|
||||
$tmpfs = $container->GetTmpfs();
|
||||
if (count($tmpfs) > 0) {
|
||||
$requestBody['HostConfig']['Tmpfs'] = $tmpfs;
|
||||
}
|
||||
|
||||
$capAdds = $container->GetCapAdds();
|
||||
if (count($capAdds) > 0) {
|
||||
$requestBody['HostConfig']['CapAdd'] = $capAdds;
|
||||
|
||||
Reference in New Issue
Block a user