Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify Readme on bind volumes to avoid apps / custom_apps mishaps #2315

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/<YOUR_CUSTOM_THEME> \
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/<YOUR_CUSTOM_THEME> \
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/<YOUR_CUSTOM_THEME> \
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.
tzerber marked this conversation as resolved.
Show resolved Hide resolved

### Custom volumes

If mounting additional volumes under `/var/www/html`, you should consider:
Expand Down