From 53c3162c831d009ffe67dc50ff7229c9456664d4 Mon Sep 17 00:00:00 2001 From: Kaloyan Nikolov Date: Thu, 17 Oct 2024 22:17:18 +0300 Subject: [PATCH 1/3] Clarify Readme on bind volumes Signed-off-by: Kaloyan Nikolov --- README.md | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d8f41dcb5..eaf4940fd 100644 --- a/README.md +++ b/README.md @@ -87,13 +87,36 @@ If you want to use named volumes for all of these, it would look like this: ```console $ docker run -d \ -v nextcloud:/var/www/html \ --v apps:/var/www/html/custom_apps \ +-v custom_apps:/var/www/html/custom_apps \ -v config:/var/www/html/config \ -v data:/var/www/html/data \ -v theme:/var/www/html/themes/ \ nextcloud ``` +If you'd prefer to use bind mounts instead of named volumes, for instance, when working with different device or network mounts for user data files and configuration: +```console +$ docker run -d \ +-v $(pwd)/nextcloud:/var/www/html \ +-v $(pwd)/custom_apps:/var/www/html/custom_apps \ +-v $(pwd)/config:/var/www/html/config \ +-v $(pwd)/data:/var/www/html/data \ +-v $(pwd)/theme:/var/www/html/themes/ \ +nextcloud +``` + +Here’s the same example using Docker's more detailed `--mount`. Note that with `-v` or `--volume`, the specified folders are created automatically if they don't exist. However, when using `--mount` for bind mounts, the directories must already exist on the host, or Docker will return an error. +```console +$ docker run -d \ +--mount type=bind,source=$(pwd)/nextcloud,target=/var/www/html \ +--mount type=bind,source=$(pwd)/custom_apps,target=/var/www/html/custom_apps \ +--mount type=bind,source=$(pwd)/config,target=/var/www/html/config \ +--mount type=bind,source=$(pwd)/data,target=/var/www/html/data \ +--mount type=bind,source=$(pwd)/theme,target=/var/www/html/themes/ \ +nextcloud +``` +The examples above use the current directory for bind mounts. If this isn't suitable, you can modify the paths by using either a relative or absolute path. Additionally, do not mix the `apps` and `custom_apps` folders. These folders contain different sets of apps, and mixing them will result in a broken installation. While upgrades\recovery may sometimes still be possible, this configuration is likely to cause issues. + ### Custom volumes If mounting additional volumes under `/var/www/html`, you should consider: From 0ee77f1a929147dc6ab9a50a32a699f377cd4d0b Mon Sep 17 00:00:00 2001 From: Kaloyan Nikolov Date: Tue, 22 Oct 2024 02:02:06 +0300 Subject: [PATCH 2/3] Clarify apps and custom_apps Co-authored-by: Josh Signed-off-by: Kaloyan Nikolov --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index eaf4940fd..bbe7ee7bc 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,9 @@ $ docker run -d \ --mount type=bind,source=$(pwd)/theme,target=/var/www/html/themes/ \ nextcloud ``` -The examples above use the current directory for bind mounts. If this isn't suitable, you can modify the paths by using either a relative or absolute path. Additionally, do not mix the `apps` and `custom_apps` folders. These folders contain different sets of apps, and mixing them will result in a broken installation. While upgrades\recovery may sometimes still be possible, this configuration is likely to cause issues. +The examples above use the current directory for bind mounts. If this isn't suitable, you can modify the paths by using either a relative or absolute path. + +NOTE: Do not confuse the `apps` and `custom_apps` folders. These folders contain different sets of apps, and mixing them will result in a broken installation. The former contains "shipped" apps, which come with Nextcloud Server. The latter contains apps you install from the App Store. ### Custom volumes From daea70d768f055118aff61f3aeaea3b43242b06d Mon Sep 17 00:00:00 2001 From: Kaloyan Nikolov Date: Tue, 12 Nov 2024 23:25:14 +0200 Subject: [PATCH 3/3] Replace bind mounts with figurative path Signed-off-by: Kaloyan Nikolov --- README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index bbe7ee7bc..60762b626 100644 --- a/README.md +++ b/README.md @@ -97,25 +97,25 @@ nextcloud If you'd prefer to use bind mounts instead of named volumes, for instance, when working with different device or network mounts for user data files and configuration: ```console $ docker run -d \ --v $(pwd)/nextcloud:/var/www/html \ --v $(pwd)/custom_apps:/var/www/html/custom_apps \ --v $(pwd)/config:/var/www/html/config \ --v $(pwd)/data:/var/www/html/data \ --v $(pwd)/theme:/var/www/html/themes/ \ +-v /path/on/host/to/folder/nextcloud:/var/www/html \ +-v /path/on/host/to/folder/custom_apps:/var/www/html/custom_apps \ +-v /path/on/host/to/folder/config:/var/www/html/config \ +-v /path/on/host/to/folder/data:/var/www/html/data \ +-v /path/on/host/to/folder/theme:/var/www/html/themes/ \ nextcloud ``` Here’s the same example using Docker's more detailed `--mount`. Note that with `-v` or `--volume`, the specified folders are created automatically if they don't exist. However, when using `--mount` for bind mounts, the directories must already exist on the host, or Docker will return an error. ```console $ docker run -d \ ---mount type=bind,source=$(pwd)/nextcloud,target=/var/www/html \ ---mount type=bind,source=$(pwd)/custom_apps,target=/var/www/html/custom_apps \ ---mount type=bind,source=$(pwd)/config,target=/var/www/html/config \ ---mount type=bind,source=$(pwd)/data,target=/var/www/html/data \ ---mount type=bind,source=$(pwd)/theme,target=/var/www/html/themes/ \ +--mount type=bind,source=/path/on/host/to/folder/nextcloud,target=/var/www/html \ +--mount type=bind,source=/path/on/host/to/folder/custom_apps,target=/var/www/html/custom_apps \ +--mount type=bind,source=/path/on/host/to/folder/config,target=/var/www/html/config \ +--mount type=bind,source=/path/on/host/to/folder/data,target=/var/www/html/data \ +--mount type=bind,source=/path/on/host/to/folder/theme,target=/var/www/html/themes/ \ nextcloud ``` -The examples above use the current directory for bind mounts. If this isn't suitable, you can modify the paths by using either a relative or absolute path. +The examples above use figurative directory `/path/on/host/to/folder/` for bind mounts. Please modify the paths by using either a relative or absolute path. NOTE: Do not confuse the `apps` and `custom_apps` folders. These folders contain different sets of apps, and mixing them will result in a broken installation. The former contains "shipped" apps, which come with Nextcloud Server. The latter contains apps you install from the App Store.