add init flag to all containers

Signed-off-by: Simon L <szaimen@e.mail.de>
This commit is contained in:
Simon L 2023-08-10 16:41:47 +02:00
parent 1b1626fe56
commit 4c0e30d49d
9 changed files with 39 additions and 0 deletions

View file

@ -1,6 +1,7 @@
services: services:
nextcloud: nextcloud:
image: nextcloud/all-in-one:latest image: nextcloud/all-in-one:latest
init: true
restart: always restart: always
container_name: nextcloud-aio-mastercontainer # This line is not allowed to be changed as otherwise AIO will not work correctly container_name: nextcloud-aio-mastercontainer # This line is not allowed to be changed as otherwise AIO will not work correctly
volumes: volumes:

View file

@ -2,6 +2,7 @@
If you want to switch to the develop channel, you simply stop and delete the mastercontainer and create a new one with a changed tag to develop: If you want to switch to the develop channel, you simply stop and delete the mastercontainer and create a new one with a changed tag to develop:
```shell ```shell
sudo docker run \ sudo docker run \
--init \
--sig-proxy=false \ --sig-proxy=false \
--name nextcloud-aio-mastercontainer \ --name nextcloud-aio-mastercontainer \
--restart always \ --restart always \

View file

@ -137,6 +137,9 @@
"read_only": { "read_only": {
"type": "boolean" "type": "boolean"
}, },
"init": {
"type": "boolean"
},
"tmpfs": { "tmpfs": {
"type": "array", "type": "array",
"items": { "items": {

View file

@ -11,6 +11,7 @@
], ],
"display_name": "Apache", "display_name": "Apache",
"image": "nextcloud/aio-apache", "image": "nextcloud/aio-apache",
"init": true,
"ports": [ "ports": [
{ {
"ip_binding": "%APACHE_IP_BINDING%", "ip_binding": "%APACHE_IP_BINDING%",
@ -69,6 +70,7 @@
"container_name": "nextcloud-aio-database", "container_name": "nextcloud-aio-database",
"display_name": "Database", "display_name": "Database",
"image": "nextcloud/aio-postgresql", "image": "nextcloud/aio-postgresql",
"init": true,
"expose": [ "expose": [
"5432" "5432"
], ],
@ -122,6 +124,7 @@
], ],
"display_name": "Nextcloud", "display_name": "Nextcloud",
"image": "nextcloud/aio-nextcloud", "image": "nextcloud/aio-nextcloud",
"init": true,
"expose": [ "expose": [
"9000" "9000"
], ],
@ -218,6 +221,7 @@
"container_name": "nextcloud-aio-notify-push", "container_name": "nextcloud-aio-notify-push",
"display_name": "Notify Push", "display_name": "Notify Push",
"image": "nextcloud/aio-notify-push", "image": "nextcloud/aio-notify-push",
"init": true,
"expose": [ "expose": [
"7867" "7867"
], ],
@ -253,6 +257,7 @@
"container_name": "nextcloud-aio-redis", "container_name": "nextcloud-aio-redis",
"display_name": "Redis", "display_name": "Redis",
"image": "nextcloud/aio-redis", "image": "nextcloud/aio-redis",
"init": true,
"expose": [ "expose": [
"6379" "6379"
], ],
@ -283,6 +288,7 @@
"container_name": "nextcloud-aio-collabora", "container_name": "nextcloud-aio-collabora",
"display_name": "Collabora", "display_name": "Collabora",
"image": "nextcloud/aio-collabora", "image": "nextcloud/aio-collabora",
"init": true,
"expose": [ "expose": [
"9980" "9980"
], ],
@ -311,6 +317,7 @@
"container_name": "nextcloud-aio-talk", "container_name": "nextcloud-aio-talk",
"display_name": "Talk", "display_name": "Talk",
"image": "nextcloud/aio-talk", "image": "nextcloud/aio-talk",
"init": true,
"ports": [ "ports": [
{ {
"ip_binding": "", "ip_binding": "",
@ -361,6 +368,7 @@
"container_name": "nextcloud-aio-talk-recording", "container_name": "nextcloud-aio-talk-recording",
"display_name": "Talk Recording", "display_name": "Talk Recording",
"image": "nextcloud/aio-talk-recording", "image": "nextcloud/aio-talk-recording",
"init": true,
"expose": [ "expose": [
"1234" "1234"
], ],
@ -392,6 +400,7 @@
{ {
"container_name": "nextcloud-aio-borgbackup", "container_name": "nextcloud-aio-borgbackup",
"image": "nextcloud/aio-borgbackup", "image": "nextcloud/aio-borgbackup",
"init": true,
"environment": [ "environment": [
"BORG_PASSWORD=%BORGBACKUP_PASSWORD%", "BORG_PASSWORD=%BORGBACKUP_PASSWORD%",
"BORG_MODE=%BORGBACKUP_MODE%", "BORG_MODE=%BORGBACKUP_MODE%",
@ -453,6 +462,7 @@
{ {
"container_name": "nextcloud-aio-watchtower", "container_name": "nextcloud-aio-watchtower",
"image": "nextcloud/aio-watchtower", "image": "nextcloud/aio-watchtower",
"init": true,
"environment": [ "environment": [
"CONTAINER_TO_UPDATE=nextcloud-aio-mastercontainer" "CONTAINER_TO_UPDATE=nextcloud-aio-mastercontainer"
], ],
@ -468,6 +478,7 @@
{ {
"container_name": "nextcloud-aio-domaincheck", "container_name": "nextcloud-aio-domaincheck",
"image": "nextcloud/aio-domaincheck", "image": "nextcloud/aio-domaincheck",
"init": true,
"ports": [ "ports": [
{ {
"ip_binding": "%APACHE_IP_BINDING%", "ip_binding": "%APACHE_IP_BINDING%",
@ -494,6 +505,7 @@
"container_name": "nextcloud-aio-clamav", "container_name": "nextcloud-aio-clamav",
"display_name": "ClamAV", "display_name": "ClamAV",
"image": "nextcloud/aio-clamav", "image": "nextcloud/aio-clamav",
"init": true,
"expose": [ "expose": [
"3310" "3310"
], ],
@ -527,6 +539,7 @@
"container_name": "nextcloud-aio-onlyoffice", "container_name": "nextcloud-aio-onlyoffice",
"display_name": "OnlyOffice", "display_name": "OnlyOffice",
"image": "nextcloud/aio-onlyoffice", "image": "nextcloud/aio-onlyoffice",
"init": true,
"expose": [ "expose": [
"80" "80"
], ],
@ -559,6 +572,7 @@
"container_name": "nextcloud-aio-imaginary", "container_name": "nextcloud-aio-imaginary",
"display_name": "Imaginary", "display_name": "Imaginary",
"image": "nextcloud/aio-imaginary", "image": "nextcloud/aio-imaginary",
"init": true,
"expose": [ "expose": [
"9000" "9000"
], ],
@ -585,6 +599,7 @@
"container_name": "nextcloud-aio-fulltextsearch", "container_name": "nextcloud-aio-fulltextsearch",
"display_name": "Fulltextsearch", "display_name": "Fulltextsearch",
"image": "nextcloud/aio-fulltextsearch", "image": "nextcloud/aio-fulltextsearch",
"init": true,
"expose": [ "expose": [
"9200" "9200"
], ],

View file

@ -32,6 +32,7 @@ class Container {
private array $nextcloudExecCommands; private array $nextcloudExecCommands;
private bool $readOnlyRootFs; private bool $readOnlyRootFs;
private array $tmpfs; private array $tmpfs;
private bool $init;
private DockerActionManager $dockerActionManager; private DockerActionManager $dockerActionManager;
public function __construct( public function __construct(
@ -54,6 +55,7 @@ class Container {
array $nextcloudExecCommands, array $nextcloudExecCommands,
bool $readOnlyRootFs, bool $readOnlyRootFs,
array $tmpfs, array $tmpfs,
bool $init,
DockerActionManager $dockerActionManager DockerActionManager $dockerActionManager
) { ) {
$this->identifier = $identifier; $this->identifier = $identifier;
@ -75,6 +77,7 @@ class Container {
$this->nextcloudExecCommands = $nextcloudExecCommands; $this->nextcloudExecCommands = $nextcloudExecCommands;
$this->readOnlyRootFs = $readOnlyRootFs; $this->readOnlyRootFs = $readOnlyRootFs;
$this->tmpfs = $tmpfs; $this->tmpfs = $tmpfs;
$this->init = $init;
$this->dockerActionManager = $dockerActionManager; $this->dockerActionManager = $dockerActionManager;
} }
@ -98,6 +101,10 @@ class Container {
return $this->readOnlyRootFs; return $this->readOnlyRootFs;
} }
public function GetInit() : bool {
return $this->init;
}
public function GetShmSize() : int { public function GetShmSize() : int {
return $this->shmSize; return $this->shmSize;
} }

View file

@ -272,6 +272,11 @@ class ContainerDefinitionFetcher
$tmpfs = $entry['tmpfs']; $tmpfs = $entry['tmpfs'];
} }
$init = true;
if (isset($entry['init'])) {
$init = $entry['init'];
}
$containers[] = new Container( $containers[] = new Container(
$entry['container_name'], $entry['container_name'],
$displayName, $displayName,
@ -292,6 +297,7 @@ class ContainerDefinitionFetcher
$nextcloudExecCommands, $nextcloudExecCommands,
$readOnlyRootFs, $readOnlyRootFs,
$tmpfs, $tmpfs,
$init,
$this->container->get(DockerActionManager::class) $this->container->get(DockerActionManager::class)
); );
} }

View file

@ -450,6 +450,8 @@ class DockerActionManager
$requestBody['HostConfig']['Tmpfs'] = $tmpfs; $requestBody['HostConfig']['Tmpfs'] = $tmpfs;
} }
$requestBody['HostConfig']['Init'] = $container->GetInit();
$capAdds = $container->GetCapAdds(); $capAdds = $container->GetCapAdds();
if (count($capAdds) > 0) { if (count($capAdds) > 0) {
$requestBody['HostConfig']['CapAdd'] = $capAdds; $requestBody['HostConfig']['CapAdd'] = $capAdds;

View file

@ -87,6 +87,7 @@ The following instructions are meant for installations without a web server or r
``` ```
# For Linux and without a web server or reverse proxy (like Apache, Nginx, Cloudflare Tunnel and else) already in place: # For Linux and without a web server or reverse proxy (like Apache, Nginx, Cloudflare Tunnel and else) already in place:
sudo docker run \ sudo docker run \
--init \
--sig-proxy=false \ --sig-proxy=false \
--name nextcloud-aio-mastercontainer \ --name nextcloud-aio-mastercontainer \
--restart always \ --restart always \
@ -157,6 +158,7 @@ On Windows, install [Docker Desktop](https://www.docker.com/products/docker-desk
``` ```
docker run ^ docker run ^
--init ^
--sig-proxy=false ^ --sig-proxy=false ^
--name nextcloud-aio-mastercontainer ^ --name nextcloud-aio-mastercontainer ^
--restart always ^ --restart always ^

View file

@ -604,6 +604,7 @@ After adjusting your reverse proxy config, use the following command to start AI
``` ```
# For Linux: # For Linux:
sudo docker run \ sudo docker run \
--init \
--sig-proxy=false \ --sig-proxy=false \
--name nextcloud-aio-mastercontainer \ --name nextcloud-aio-mastercontainer \
--restart always \ --restart always \
@ -629,6 +630,7 @@ On Windows, install [Docker Desktop](https://www.docker.com/products/docker-desk
``` ```
docker run ^ docker run ^
--init ^
--sig-proxy=false ^ --sig-proxy=false ^
--name nextcloud-aio-mastercontainer ^ --name nextcloud-aio-mastercontainer ^
--restart always ^ --restart always ^