mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-11-11 14:40:48 +08:00
Merge pull request #636 from nextcloud/enh/558/docker-socket-path
allow to specify the docker socket path
This commit is contained in:
commit
2d9a1afa33
7 changed files with 25 additions and 3 deletions
|
|
@ -114,6 +114,14 @@ It is set to '$APACHE_PORT'."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
if [ -n "$DOCKER_SOCKET_PATH" ]; then
|
||||||
|
if ! echo "$DOCKER_SOCKET_PATH" | grep -q "^/" || echo "$DOCKER_SOCKET_PATH" | grep -q "/$"; then
|
||||||
|
echo "You've set DOCKER_SOCKET_PATH but not to an allowed value.
|
||||||
|
The string must start with '/' and must not end with '/'.
|
||||||
|
It is set to '$DOCKER_SOCKET_PATH'."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Check DNS resolution
|
# Check DNS resolution
|
||||||
# Prevents issues like https://github.com/nextcloud/all-in-one/discussions/565
|
# Prevents issues like https://github.com/nextcloud/all-in-one/discussions/565
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ services:
|
||||||
# - APACHE_PORT=11000 # Is needed when running behind a reverse proxy. See https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md
|
# - APACHE_PORT=11000 # Is needed when running behind a reverse proxy. See https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md
|
||||||
# - NEXTCLOUD_DATADIR=/mnt/ncdata # Allows to set the host directory for Nextcloud's datadir. See https://github.com/nextcloud/all-in-one#how-to-change-the-default-location-of-nextclouds-datadir
|
# - NEXTCLOUD_DATADIR=/mnt/ncdata # Allows to set the host directory for Nextcloud's datadir. See https://github.com/nextcloud/all-in-one#how-to-change-the-default-location-of-nextclouds-datadir
|
||||||
# - NEXTCLOUD_MOUNT=/mnt/ # Allows the Nextcloud container to access the chosen directory on the host. See https://github.com/nextcloud/all-in-one#how-to-allow-the-nextcloud-container-to-access-directories-on-the-host
|
# - NEXTCLOUD_MOUNT=/mnt/ # Allows the Nextcloud container to access the chosen directory on the host. See https://github.com/nextcloud/all-in-one#how-to-allow-the-nextcloud-container-to-access-directories-on-the-host
|
||||||
|
# - DOCKER_SOCKET_PATH="/var/run/docker.sock" # Needs to be specified if the docker socket on the host is not located in the default '/var/run/docker.sock'. Otherwise mastercontainer updates will fail.
|
||||||
|
|
||||||
# # Optional: Caddy reverse proxy. See https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md
|
# # Optional: Caddy reverse proxy. See https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md
|
||||||
# # You can find further examples here: https://github.com/nextcloud/all-in-one/discussions/588
|
# # You can find further examples here: https://github.com/nextcloud/all-in-one/discussions/588
|
||||||
|
|
|
||||||
|
|
@ -283,7 +283,7 @@
|
||||||
],
|
],
|
||||||
"volumes": [
|
"volumes": [
|
||||||
{
|
{
|
||||||
"name": "/var/run/docker.sock",
|
"name": "%DOCKER_SOCKET_PATH%",
|
||||||
"location": "/var/run/docker.sock",
|
"location": "/var/run/docker.sock",
|
||||||
"writeable": false
|
"writeable": false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -101,6 +101,11 @@ class ContainerDefinitionFetcher
|
||||||
if ($value['name'] === '') {
|
if ($value['name'] === '') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
} elseif ($value['name'] === '%DOCKER_SOCKET_PATH%') {
|
||||||
|
$value['name'] = $this->configurationManager->GetDockerSocketPath();
|
||||||
|
if($value['name'] === '') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ($value['location'] === '%NEXTCLOUD_MOUNT%') {
|
if ($value['location'] === '%NEXTCLOUD_MOUNT%') {
|
||||||
$value['location'] = $this->configurationManager->GetNextcloudMount();
|
$value['location'] = $this->configurationManager->GetNextcloudMount();
|
||||||
|
|
|
||||||
|
|
@ -453,6 +453,13 @@ class ConfigurationManager
|
||||||
return $this->GetEnvironmentalVariableOrConfig($envVariableName, $configName, $defaultValue);
|
return $this->GetEnvironmentalVariableOrConfig($envVariableName, $configName, $defaultValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function GetDockerSocketPath() : string {
|
||||||
|
$envVariableName = 'DOCKER_SOCKET_PATH';
|
||||||
|
$configName = 'docker_socket_path';
|
||||||
|
$defaultValue = '/var/run/docker.sock';
|
||||||
|
return $this->GetEnvironmentalVariableOrConfig($envVariableName, $configName, $defaultValue);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws InvalidSettingConfigurationException
|
* @throws InvalidSettingConfigurationException
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ Only those (if you access the Mastercontainer Interface internally via port 8080
|
||||||
- `3478/TCP` and `3478/UDP`: will be used by the Turnserver inside the Talk container and needs to be open in your firewall/router
|
- `3478/TCP` and `3478/UDP`: will be used by the Turnserver inside the Talk container and needs to be open in your firewall/router
|
||||||
|
|
||||||
### How to run it on macOS?
|
### How to run it on macOS?
|
||||||
On macOS, there is one specialty in comparison to Linux: instead of using `--volume /var/run/docker.sock:/var/run/docker.sock:ro`, you need to use `--volume /var/run/docker.sock.raw:/var/run/docker.sock:ro` to run it after you installed [Docker Desktop](https://www.docker.com/products/docker-desktop/). Apart from that it should work and behave the same like on Linux.
|
On macOS, there are two things different in comparison to Linux: instead of using `--volume /var/run/docker.sock:/var/run/docker.sock:ro`, you need to use `--volume /var/run/docker.sock.raw:/var/run/docker.sock:ro` to run it after you installed [Docker Desktop](https://www.docker.com/products/docker-desktop/). You also need to add `-e DOCKER_SOCKET_PATH="/var/run/docker.sock.raw"`to the startup command. Apart from that it should work and behave the same like on Linux.
|
||||||
|
|
||||||
### How to run it on Windows?
|
### How to run it on Windows?
|
||||||
On Windows, the following command should work after you installed [Docker Desktop](https://www.docker.com/products/docker-desktop/):
|
On Windows, the following command should work after you installed [Docker Desktop](https://www.docker.com/products/docker-desktop/):
|
||||||
|
|
|
||||||
|
|
@ -4,5 +4,6 @@
|
||||||
- [ ] Make also sure that reverse proxies work by following https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md#reverse-proxy-documentation and following [001-initial-setup.md](./001-initial-setup.md) and [002-new-instance.md](./002-new-instance.md)
|
- [ ] Make also sure that reverse proxies work by following https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md#reverse-proxy-documentation and following [001-initial-setup.md](./001-initial-setup.md) and [002-new-instance.md](./002-new-instance.md)
|
||||||
- [ ] When starting the mastercontainer with `-e NEXTCLOUD_DATADIR="/mnt/testdata"` it should map that location from `/mnt/testdata` to `/mnt/ncdata` inside the Nextcloud container. Not having adjusted the permissions correctly before starting the Nextcloud container the first time will not allow the Nextcloud container to start correctly. See https://github.com/nextcloud/all-in-one#how-to-change-the-default-location-of-nextclouds-datadir for allowed values.
|
- [ ] When starting the mastercontainer with `-e NEXTCLOUD_DATADIR="/mnt/testdata"` it should map that location from `/mnt/testdata` to `/mnt/ncdata` inside the Nextcloud container. Not having adjusted the permissions correctly before starting the Nextcloud container the first time will not allow the Nextcloud container to start correctly. See https://github.com/nextcloud/all-in-one#how-to-change-the-default-location-of-nextclouds-datadir for allowed values.
|
||||||
- [ ] When starting the mastercontainer with `-e NEXTCLOUD_MOUNT="/mnt/"` it should map `/mnt/` to `/mnt/` inside the Nextcloud container. See https://github.com/nextcloud/all-in-one#how-to-allow-the-nextcloud-container-to-access-directories-on-the-host for allowed values.
|
- [ ] When starting the mastercontainer with `-e NEXTCLOUD_MOUNT="/mnt/"` it should map `/mnt/` to `/mnt/` inside the Nextcloud container. See https://github.com/nextcloud/all-in-one#how-to-allow-the-nextcloud-container-to-access-directories-on-the-host for allowed values.
|
||||||
|
- [ ] When starting the mastercontainer with `-e DOCKER_SOCKET_PATH="/var/run/docker.sock.raw"` it should map `/var/run/docker.sock.raw` to `/var/run/docker.sock` inside the watchtower container which allow to update the mastercontainer on macos and with docker rootless.
|
||||||
|
|
||||||
You can now continue with [070-timezone-change.md](./070-timezone-change.md)
|
You can now continue with [070-timezone-change.md](./070-timezone-change.md)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue