From a46493fbc4dfbc8e216ede5beb7b0137456f14da Mon Sep 17 00:00:00 2001 From: Tilo Spannagel Date: Mon, 1 Oct 2018 15:28:13 +0200 Subject: [PATCH] Use exclude file for the updater Signed-off-by: Tilo Spannagel --- Dockerfile-alpine.template | 2 +- Dockerfile-debian.template | 2 +- docker-entrypoint.sh | 2 +- update.sh | 3 +++ upgrade.exclude | 4 ++++ 5 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 upgrade.exclude diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index db40530..9bb6e9e 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -111,7 +111,7 @@ RUN set -ex; \ chmod +x /usr/src/nextcloud/occ; \ apk del .fetch-deps -COPY *.sh / +COPY *.sh upgrade.exclude / COPY config/* /usr/src/nextcloud/config/ ENTRYPOINT ["/entrypoint.sh"] diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template index ab6f88f..54c2842 100644 --- a/Dockerfile-debian.template +++ b/Dockerfile-debian.template @@ -126,7 +126,7 @@ RUN set -ex; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ rm -rf /var/lib/apt/lists/* -COPY *.sh / +COPY *.sh upgrade.exclude / COPY config/* /usr/src/nextcloud/config/ ENTRYPOINT ["/entrypoint.sh"] diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index c31db1a..f84eb7e 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -44,7 +44,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then else rsync_options="-rlD" fi - rsync $rsync_options --delete --exclude /config/ --exclude /data/ --exclude /custom_apps/ --exclude /themes/ /usr/src/nextcloud/ /var/www/html/ + rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ for dir in config data custom_apps themes; do if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then diff --git a/update.sh b/update.sh index 263935a..16c1104 100755 --- a/update.sh +++ b/update.sh @@ -85,6 +85,9 @@ function create_variant() { cp "docker-$name.sh" "$dir/$name.sh" done + # Copy the upgrade.exclude + cp upgrade.exclude "$dir/" + # Copy the config directory cp -rT .config "$dir/config" diff --git a/upgrade.exclude b/upgrade.exclude new file mode 100644 index 0000000..a1f2de9 --- /dev/null +++ b/upgrade.exclude @@ -0,0 +1,4 @@ +/config/ +/data/ +/custom_apps/ +/themes/