Docker: New instance's initialization removes everything in /var/www/html

Created on 25 Jun 2020  路  2Comments  路  Source: nextcloud/docker

The issue

When I tried to use this this image, mounted /var/www/html with a directory previously used for nextcloud, I ended up realizing the image deleted everything in that directory. I felt lucky that I used a separate data directory for my original nextcloud files.
This happens to be done at entrypoint.sh:98

This could be a problem when someone just wanted to dockerize their server and/or moving services around systems.

Steps to reproduce

mkdir nextcloud_data
touch nextcloud_data/foo
docker run --rm -itv $PWD/nextcloud_data:/var/www/html nextcloud
[wait until it says "Initializing finished"]
^C
[nextcloud_data/foo is removed]

Possible fix

Maybe moving the original file to a backup directory is better.

Most helpful comment

@doc75 Thanks for your reply. Yes, you're right. After reading the code I found /upgrade.exclude which did that job.
However, as this is the _official_ image, I guess there will be other silly people like me who ran into the same issue.
So I'll try to note that in the documentation.

All 2 comments

@myzhang1029 I think this is the expected behaviour. This folder is updated, but you have an exclusion list that prevent data directory inside /var/www/html to be modified. The fact that your foo file get deleted seems normal to me.

@doc75 Thanks for your reply. Yes, you're right. After reading the code I found /upgrade.exclude which did that job.
However, as this is the _official_ image, I guess there will be other silly people like me who ran into the same issue.
So I'll try to note that in the documentation.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

mahnunchik picture mahnunchik  路  3Comments

waldner picture waldner  路  3Comments

pr4xx picture pr4xx  路  4Comments

DisasteR picture DisasteR  路  3Comments