2021-11-30 11:20:42 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace AIO\Container;
|
|
|
|
|
|
|
|
|
|
use AIO\Data\ConfigurationManager;
|
|
|
|
|
use AIO\Docker\DockerActionManager;
|
|
|
|
|
use AIO\ContainerDefinitionFetcher;
|
|
|
|
|
|
2024-10-07 10:12:43 +02:00
|
|
|
readonly class Container {
|
2021-11-30 11:20:42 +01:00
|
|
|
public function __construct(
|
2024-10-07 10:12:43 +02:00
|
|
|
private string $identifier,
|
|
|
|
|
private string $displayName,
|
|
|
|
|
private string $containerName,
|
|
|
|
|
private string $restartPolicy,
|
|
|
|
|
private int $maxShutdownTime,
|
|
|
|
|
private ContainerPorts $ports,
|
|
|
|
|
private string $internalPorts,
|
|
|
|
|
private ContainerVolumes $volumes,
|
|
|
|
|
private ContainerEnvironmentVariables $containerEnvironmentVariables,
|
|
|
|
|
/** @var string[] */
|
|
|
|
|
private array $dependsOn,
|
|
|
|
|
/** @var string[] */
|
|
|
|
|
private array $secrets,
|
|
|
|
|
/** @var string[] */
|
|
|
|
|
private array $devices,
|
|
|
|
|
/** @var string[] */
|
|
|
|
|
private array $capAdd,
|
|
|
|
|
private int $shmSize,
|
|
|
|
|
private bool $apparmorUnconfined,
|
|
|
|
|
/** @var string[] */
|
|
|
|
|
private array $backupVolumes,
|
|
|
|
|
private array $nextcloudExecCommands,
|
|
|
|
|
private bool $readOnlyRootFs,
|
|
|
|
|
private array $tmpfs,
|
|
|
|
|
private bool $init,
|
|
|
|
|
private string $imageTag,
|
|
|
|
|
private AioVariables $aioVariables,
|
|
|
|
|
private string $documentation,
|
|
|
|
|
private DockerActionManager $dockerActionManager
|
2021-11-30 11:20:42 +01:00
|
|
|
) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function GetIdentifier() : string {
|
|
|
|
|
return $this->identifier;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function GetDisplayName() : string {
|
|
|
|
|
return $this->displayName;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function GetContainerName() : string {
|
|
|
|
|
return $this->containerName;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function GetRestartPolicy() : string {
|
|
|
|
|
return $this->restartPolicy;
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-17 16:28:42 +02:00
|
|
|
public function GetImageTag() : string {
|
|
|
|
|
return $this->imageTag;
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-31 16:46:19 +02:00
|
|
|
public function GetReadOnlySetting() : bool {
|
|
|
|
|
return $this->readOnlyRootFs;
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-10 16:41:47 +02:00
|
|
|
public function GetInit() : bool {
|
|
|
|
|
return $this->init;
|
|
|
|
|
}
|
|
|
|
|
|
2023-03-31 11:27:11 +02:00
|
|
|
public function GetShmSize() : int {
|
2023-03-29 10:57:44 +02:00
|
|
|
return $this->shmSize;
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-27 19:24:14 +02:00
|
|
|
public function isApparmorUnconfined() : bool {
|
|
|
|
|
return $this->apparmorUnconfined;
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-30 11:20:42 +01:00
|
|
|
public function GetMaxShutdownTime() : int {
|
|
|
|
|
return $this->maxShutdownTime;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function GetSecrets() : array {
|
|
|
|
|
return $this->secrets;
|
|
|
|
|
}
|
|
|
|
|
|
2023-06-19 13:04:39 +02:00
|
|
|
public function GetTmpfs() : array {
|
|
|
|
|
return $this->tmpfs;
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-03 02:01:03 +01:00
|
|
|
public function GetDevices() : array {
|
|
|
|
|
return $this->devices;
|
|
|
|
|
}
|
|
|
|
|
|
2023-03-06 11:36:36 +01:00
|
|
|
public function GetCapAdds() : array {
|
|
|
|
|
return $this->capAdd;
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-17 20:48:08 +02:00
|
|
|
public function GetBackupVolumes() : array {
|
|
|
|
|
return $this->backupVolumes;
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-30 11:20:42 +01:00
|
|
|
public function GetPorts() : ContainerPorts {
|
|
|
|
|
return $this->ports;
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-25 01:40:37 +01:00
|
|
|
public function GetInternalPort() : string {
|
2021-11-30 11:20:42 +01:00
|
|
|
return $this->internalPorts;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function GetVolumes() : ContainerVolumes {
|
|
|
|
|
return $this->volumes;
|
|
|
|
|
}
|
|
|
|
|
|
2024-10-07 13:20:49 +02:00
|
|
|
public function GetRunningState() : ContainerState {
|
2021-11-30 11:20:42 +01:00
|
|
|
return $this->dockerActionManager->GetContainerRunningState($this);
|
|
|
|
|
}
|
|
|
|
|
|
2024-10-07 13:20:49 +02:00
|
|
|
public function GetRestartingState() : ContainerState {
|
2022-03-15 12:45:31 +01:00
|
|
|
return $this->dockerActionManager->GetContainerRestartingState($this);
|
|
|
|
|
}
|
|
|
|
|
|
2024-10-02 15:00:13 +02:00
|
|
|
public function GetUpdateState() : VersionState {
|
2021-11-30 11:20:42 +01:00
|
|
|
return $this->dockerActionManager->GetContainerUpdateState($this);
|
|
|
|
|
}
|
|
|
|
|
|
2024-10-07 13:20:49 +02:00
|
|
|
public function GetStartingState() : ContainerState {
|
2021-11-30 11:20:42 +01:00
|
|
|
return $this->dockerActionManager->GetContainerStartingState($this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return string[]
|
|
|
|
|
*/
|
|
|
|
|
public function GetDependsOn() : array {
|
|
|
|
|
return $this->dependsOn;
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-01 18:37:33 +02:00
|
|
|
public function GetNextcloudExecCommands() : array {
|
|
|
|
|
return $this->nextcloudExecCommands;
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-30 11:20:42 +01:00
|
|
|
public function GetEnvironmentVariables() : ContainerEnvironmentVariables {
|
|
|
|
|
return $this->containerEnvironmentVariables;
|
|
|
|
|
}
|
2023-09-29 21:44:12 +02:00
|
|
|
|
|
|
|
|
public function GetAioVariables() : AioVariables {
|
|
|
|
|
return $this->aioVariables;
|
|
|
|
|
}
|
2023-10-03 20:30:46 +02:00
|
|
|
|
|
|
|
|
public function GetDocumentation() : string {
|
|
|
|
|
return $this->documentation;
|
|
|
|
|
}
|
2021-11-30 11:20:42 +01:00
|
|
|
}
|