docker
docker copied to clipboard
Initialization completely clears /var/www/html directory
How to use GitHub
- Please use the 👍 reaction to show that you are affected by the same issue.
- Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
- Subscribe to receive notifications on status change and new comments.
Steps to reproduce
- Create some test files and folders in a (otherwise empty) directory
- Setup Nextcloud using the
17.0.5-apache
Docker image, mounting the mentioned directory as/var/www/html/
- Start the docker image
Expected behaviour
Existing files that don't belong to a Nextcloud installation are left intact.
Actual behaviour
The directory is cleared completely, including all files and directories within.
This is fatal when you accidentally mount a wrong path as /var/www/html/
. In my case, I accidentally mounted /docker
instead of /docker/nextcloud
, and thus lost all my docker container data.
Server configuration
17.0.5-apache
docker image from Docker Hub.
Logs
22:13:47 Initializing nextcloud 17.0.5.0 ...
22:15:03 Initializing finished
22:15:03 New nextcloud instance
Culprit is in entrypoint.sh:
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
the --delete option.
Also causes issues when modifying the /var/www/html/ directory in a Dockerfile. Results are lost.
Fixed in #1862 Docs updated: https://github.com/nextcloud/docker#persistent-data