docker icon indicating copy to clipboard operation
docker copied to clipboard

Initialization completely clears /var/www/html directory

Open bllngr opened this issue 4 years ago • 1 comments

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

  1. Create some test files and folders in a (otherwise empty) directory
  2. Setup Nextcloud using the 17.0.5-apache Docker image, mounting the mentioned directory as /var/www/html/
  3. 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

bllngr avatar Mar 29 '20 19:03 bllngr

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.

orangutanga avatar Mar 25 '22 01:03 orangutanga

Fixed in #1862 Docs updated: https://github.com/nextcloud/docker#persistent-data

joshtrichards avatar Oct 21 '23 15:10 joshtrichards