This commit updates the directory permissions to be more compatible when
running the image without root f.e. on OpenShift or when specifying it
when running with `docker run --user www-data:root ...`.
It adds detection logic to the entrypoint script as sudo is not always
allowed.
This change in directory permissions was also proposed by the official
documentation, see https://github.com/nextcloud/documentation/commit/22e2530.
The `chown` before the volume definition is needed to prepare the volume
as it inherits the permissions.
refs https://github.com/nextcloud/docker/issues/107
In order to match ownCloud's Docker images, we need to provide -apache
and -fpm variant images as well as maintaining version tags for older
images.
These scripts are improved versions of the ownCloud scripts[1] because
they also automatically generate the directories with each ./update.sh,
and also generate all aliases without needing human intervention.
[1]: https://github.com/docker-library/owncloud/blob/master/generate-stackbrew-library.sh
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>