This commit is contained in:
Mike Cronce 2025-12-13 13:02:49 +05:30 committed by GitHub
commit e4cdd4cae3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 162 additions and 83 deletions

View File

@ -132,7 +132,11 @@ RUN { \
chown -R www-data:root /var/www; \
chmod -R g=u /var/www
VOLUME /var/www/html
VOLUME /var/www/html/data
VOLUME /var/www/html/config
VOLUME /var/www/html/custom_apps
VOLUME /var/www/html/themes
VOLUME /var/www/tmp
RUN a2enmod headers rewrite remoteip ; \
{ \
@ -167,12 +171,17 @@ RUN set -ex; \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
tar -xjf nextcloud.tar.bz2 -C /usr/src/; \
mkdir /usr/src/nextcloud-base; \
mv -vf /usr/src/nextcloud/config /usr/src/nextcloud/themes /usr/src/nextcloud-base/; \
rm -Rvf /var/www/html; \
mv -vf /usr/src/nextcloud /var/www/html; \
mv -vf /usr/src/nextcloud-base /usr/src/nextcloud; \
gpgconf --kill all; \
rm nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
rm -rf "$GNUPGHOME" /usr/src/nextcloud/updater; \
mkdir -p /usr/src/nextcloud/data; \
mkdir -p /usr/src/nextcloud/custom_apps; \
chmod +x /usr/src/nextcloud/occ; \
rm -rf "$GNUPGHOME" /var/www/html/updater; \
mkdir -p /var/www/html/data; \
mkdir -p /var/www/html/custom_apps; \
mkdir -p /var/www/html/themes; \
chmod +x /var/www/html/occ; \
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \
apt-get dist-clean

View File

@ -157,12 +157,12 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi
installed_version="0.0.0.0"
if [ -f /var/www/html/version.php ]; then
if [ -f /var/www/html/config/version.php ]; then
# shellcheck disable=SC2016
installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
installed_version="$(php -r 'require "/var/www/html/config/version.php"; echo implode(".", $OC_Version);')"
fi
# shellcheck disable=SC2016
image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')"
image_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
if version_greater "$installed_version" "$image_version"; then
echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?"
@ -186,13 +186,11 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
rsync_options="-rlD"
fi
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
rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/
fi
done
rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/
# Install
if [ "$installed_version" = "0.0.0.0" ]; then
@ -284,6 +282,9 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
run_path post-upgrade
fi
cp -vf /var/www/html/version.php /var/www/html/config/
chown -c $user:$group /var/www/html/config/version.php
echo "Initializing finished"
fi

View File

@ -125,7 +125,11 @@ RUN { \
chown -R www-data:root /var/www; \
chmod -R g=u /var/www
VOLUME /var/www/html
VOLUME /var/www/html/data
VOLUME /var/www/html/config
VOLUME /var/www/html/custom_apps
VOLUME /var/www/html/themes
VOLUME /var/www/tmp
ENV NEXTCLOUD_VERSION 31.0.12
@ -143,12 +147,17 @@ RUN set -ex; \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
tar -xjf nextcloud.tar.bz2 -C /usr/src/; \
mkdir /usr/src/nextcloud-base; \
mv -vf /usr/src/nextcloud/config /usr/src/nextcloud/themes /usr/src/nextcloud-base/; \
rm -Rvf /var/www/html; \
mv -vf /usr/src/nextcloud /var/www/html; \
mv -vf /usr/src/nextcloud-base /usr/src/nextcloud; \
gpgconf --kill all; \
rm nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
rm -rf "$GNUPGHOME" /usr/src/nextcloud/updater; \
mkdir -p /usr/src/nextcloud/data; \
mkdir -p /usr/src/nextcloud/custom_apps; \
chmod +x /usr/src/nextcloud/occ; \
rm -rf "$GNUPGHOME" /var/www/html/updater; \
mkdir -p /var/www/html/data; \
mkdir -p /var/www/html/custom_apps; \
mkdir -p /var/www/html/themes; \
chmod +x /var/www/html/occ; \
apk del --no-network .fetch-deps
COPY *.sh upgrade.exclude /

View File

@ -157,12 +157,12 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi
installed_version="0.0.0.0"
if [ -f /var/www/html/version.php ]; then
if [ -f /var/www/html/config/version.php ]; then
# shellcheck disable=SC2016
installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
installed_version="$(php -r 'require "/var/www/html/config/version.php"; echo implode(".", $OC_Version);')"
fi
# shellcheck disable=SC2016
image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')"
image_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
if version_greater "$installed_version" "$image_version"; then
echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?"
@ -186,13 +186,11 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
rsync_options="-rlD"
fi
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
rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/
fi
done
rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/
# Install
if [ "$installed_version" = "0.0.0.0" ]; then
@ -284,6 +282,9 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
run_path post-upgrade
fi
cp -vf /var/www/html/version.php /var/www/html/config/
chown -c $user:$group /var/www/html/config/version.php
echo "Initializing finished"
fi

View File

@ -132,7 +132,11 @@ RUN { \
chown -R www-data:root /var/www; \
chmod -R g=u /var/www
VOLUME /var/www/html
VOLUME /var/www/html/data
VOLUME /var/www/html/config
VOLUME /var/www/html/custom_apps
VOLUME /var/www/html/themes
VOLUME /var/www/tmp
ENV NEXTCLOUD_VERSION 31.0.12
@ -152,12 +156,17 @@ RUN set -ex; \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
tar -xjf nextcloud.tar.bz2 -C /usr/src/; \
mkdir /usr/src/nextcloud-base; \
mv -vf /usr/src/nextcloud/config /usr/src/nextcloud/themes /usr/src/nextcloud-base/; \
rm -Rvf /var/www/html; \
mv -vf /usr/src/nextcloud /var/www/html; \
mv -vf /usr/src/nextcloud-base /usr/src/nextcloud; \
gpgconf --kill all; \
rm nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
rm -rf "$GNUPGHOME" /usr/src/nextcloud/updater; \
mkdir -p /usr/src/nextcloud/data; \
mkdir -p /usr/src/nextcloud/custom_apps; \
chmod +x /usr/src/nextcloud/occ; \
rm -rf "$GNUPGHOME" /var/www/html/updater; \
mkdir -p /var/www/html/data; \
mkdir -p /var/www/html/custom_apps; \
mkdir -p /var/www/html/themes; \
chmod +x /var/www/html/occ; \
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \
apt-get dist-clean

View File

@ -157,12 +157,12 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi
installed_version="0.0.0.0"
if [ -f /var/www/html/version.php ]; then
if [ -f /var/www/html/config/version.php ]; then
# shellcheck disable=SC2016
installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
installed_version="$(php -r 'require "/var/www/html/config/version.php"; echo implode(".", $OC_Version);')"
fi
# shellcheck disable=SC2016
image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')"
image_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
if version_greater "$installed_version" "$image_version"; then
echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?"
@ -186,13 +186,11 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
rsync_options="-rlD"
fi
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
rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/
fi
done
rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/
# Install
if [ "$installed_version" = "0.0.0.0" ]; then
@ -284,6 +282,9 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
run_path post-upgrade
fi
cp -vf /var/www/html/version.php /var/www/html/config/
chown -c $user:$group /var/www/html/config/version.php
echo "Initializing finished"
fi

View File

@ -132,7 +132,11 @@ RUN { \
chown -R www-data:root /var/www; \
chmod -R g=u /var/www
VOLUME /var/www/html
VOLUME /var/www/html/data
VOLUME /var/www/html/config
VOLUME /var/www/html/custom_apps
VOLUME /var/www/html/themes
VOLUME /var/www/tmp
RUN a2enmod headers rewrite remoteip ; \
{ \
@ -167,12 +171,17 @@ RUN set -ex; \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
tar -xjf nextcloud.tar.bz2 -C /usr/src/; \
mkdir /usr/src/nextcloud-base; \
mv -vf /usr/src/nextcloud/config /usr/src/nextcloud/themes /usr/src/nextcloud-base/; \
rm -Rvf /var/www/html; \
mv -vf /usr/src/nextcloud /var/www/html; \
mv -vf /usr/src/nextcloud-base /usr/src/nextcloud; \
gpgconf --kill all; \
rm nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
rm -rf "$GNUPGHOME" /usr/src/nextcloud/updater; \
mkdir -p /usr/src/nextcloud/data; \
mkdir -p /usr/src/nextcloud/custom_apps; \
chmod +x /usr/src/nextcloud/occ; \
rm -rf "$GNUPGHOME" /var/www/html/updater; \
mkdir -p /var/www/html/data; \
mkdir -p /var/www/html/custom_apps; \
mkdir -p /var/www/html/themes; \
chmod +x /var/www/html/occ; \
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \
apt-get dist-clean

View File

@ -157,12 +157,12 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi
installed_version="0.0.0.0"
if [ -f /var/www/html/version.php ]; then
if [ -f /var/www/html/config/version.php ]; then
# shellcheck disable=SC2016
installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
installed_version="$(php -r 'require "/var/www/html/config/version.php"; echo implode(".", $OC_Version);')"
fi
# shellcheck disable=SC2016
image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')"
image_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
if version_greater "$installed_version" "$image_version"; then
echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?"
@ -186,13 +186,11 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
rsync_options="-rlD"
fi
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
rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/
fi
done
rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/
# Install
if [ "$installed_version" = "0.0.0.0" ]; then
@ -284,6 +282,9 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
run_path post-upgrade
fi
cp -vf /var/www/html/version.php /var/www/html/config/
chown -c $user:$group /var/www/html/config/version.php
echo "Initializing finished"
fi

View File

@ -125,7 +125,11 @@ RUN { \
chown -R www-data:root /var/www; \
chmod -R g=u /var/www
VOLUME /var/www/html
VOLUME /var/www/html/data
VOLUME /var/www/html/config
VOLUME /var/www/html/custom_apps
VOLUME /var/www/html/themes
VOLUME /var/www/tmp
ENV NEXTCLOUD_VERSION 32.0.3
@ -143,12 +147,17 @@ RUN set -ex; \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
tar -xjf nextcloud.tar.bz2 -C /usr/src/; \
mkdir /usr/src/nextcloud-base; \
mv -vf /usr/src/nextcloud/config /usr/src/nextcloud/themes /usr/src/nextcloud-base/; \
rm -Rvf /var/www/html; \
mv -vf /usr/src/nextcloud /var/www/html; \
mv -vf /usr/src/nextcloud-base /usr/src/nextcloud; \
gpgconf --kill all; \
rm nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
rm -rf "$GNUPGHOME" /usr/src/nextcloud/updater; \
mkdir -p /usr/src/nextcloud/data; \
mkdir -p /usr/src/nextcloud/custom_apps; \
chmod +x /usr/src/nextcloud/occ; \
rm -rf "$GNUPGHOME" /var/www/html/updater; \
mkdir -p /var/www/html/data; \
mkdir -p /var/www/html/custom_apps; \
mkdir -p /var/www/html/themes; \
chmod +x /var/www/html/occ; \
apk del --no-network .fetch-deps
COPY *.sh upgrade.exclude /

View File

@ -157,12 +157,12 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi
installed_version="0.0.0.0"
if [ -f /var/www/html/version.php ]; then
if [ -f /var/www/html/config/version.php ]; then
# shellcheck disable=SC2016
installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
installed_version="$(php -r 'require "/var/www/html/config/version.php"; echo implode(".", $OC_Version);')"
fi
# shellcheck disable=SC2016
image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')"
image_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
if version_greater "$installed_version" "$image_version"; then
echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?"
@ -186,13 +186,11 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
rsync_options="-rlD"
fi
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
rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/
fi
done
rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/
# Install
if [ "$installed_version" = "0.0.0.0" ]; then
@ -284,6 +282,9 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
run_path post-upgrade
fi
cp -vf /var/www/html/version.php /var/www/html/config/
chown -c $user:$group /var/www/html/config/version.php
echo "Initializing finished"
fi

View File

@ -132,7 +132,11 @@ RUN { \
chown -R www-data:root /var/www; \
chmod -R g=u /var/www
VOLUME /var/www/html
VOLUME /var/www/html/data
VOLUME /var/www/html/config
VOLUME /var/www/html/custom_apps
VOLUME /var/www/html/themes
VOLUME /var/www/tmp
ENV NEXTCLOUD_VERSION 32.0.3
@ -152,12 +156,17 @@ RUN set -ex; \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
tar -xjf nextcloud.tar.bz2 -C /usr/src/; \
mkdir /usr/src/nextcloud-base; \
mv -vf /usr/src/nextcloud/config /usr/src/nextcloud/themes /usr/src/nextcloud-base/; \
rm -Rvf /var/www/html; \
mv -vf /usr/src/nextcloud /var/www/html; \
mv -vf /usr/src/nextcloud-base /usr/src/nextcloud; \
gpgconf --kill all; \
rm nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
rm -rf "$GNUPGHOME" /usr/src/nextcloud/updater; \
mkdir -p /usr/src/nextcloud/data; \
mkdir -p /usr/src/nextcloud/custom_apps; \
chmod +x /usr/src/nextcloud/occ; \
rm -rf "$GNUPGHOME" /var/www/html/updater; \
mkdir -p /var/www/html/data; \
mkdir -p /var/www/html/custom_apps; \
mkdir -p /var/www/html/themes; \
chmod +x /var/www/html/occ; \
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \
apt-get dist-clean

View File

@ -157,12 +157,12 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi
installed_version="0.0.0.0"
if [ -f /var/www/html/version.php ]; then
if [ -f /var/www/html/config/version.php ]; then
# shellcheck disable=SC2016
installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
installed_version="$(php -r 'require "/var/www/html/config/version.php"; echo implode(".", $OC_Version);')"
fi
# shellcheck disable=SC2016
image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')"
image_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
if version_greater "$installed_version" "$image_version"; then
echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?"
@ -186,13 +186,11 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
rsync_options="-rlD"
fi
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
rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/
fi
done
rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/
# Install
if [ "$installed_version" = "0.0.0.0" ]; then
@ -284,6 +282,9 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
run_path post-upgrade
fi
cp -vf /var/www/html/version.php /var/www/html/config/
chown -c $user:$group /var/www/html/config/version.php
echo "Initializing finished"
fi

View File

@ -124,7 +124,11 @@ RUN { \
chown -R www-data:root /var/www; \
chmod -R g=u /var/www
VOLUME /var/www/html
VOLUME /var/www/html/data
VOLUME /var/www/html/config
VOLUME /var/www/html/custom_apps
VOLUME /var/www/html/themes
VOLUME /var/www/tmp
%%VARIANT_EXTRAS%%
ENV NEXTCLOUD_VERSION %%VERSION%%
@ -142,12 +146,17 @@ RUN set -ex; \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
tar -xjf nextcloud.tar.bz2 -C /usr/src/; \
mkdir /usr/src/nextcloud-base; \
mv -vf /usr/src/nextcloud/config /usr/src/nextcloud/themes /usr/src/nextcloud-base/; \
rm -Rvf /var/www/html; \
mv -vf /usr/src/nextcloud /var/www/html; \
mv -vf /usr/src/nextcloud-base /usr/src/nextcloud; \
gpgconf --kill all; \
rm nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
rm -rf "$GNUPGHOME" /usr/src/nextcloud/updater; \
mkdir -p /usr/src/nextcloud/data; \
mkdir -p /usr/src/nextcloud/custom_apps; \
chmod +x /usr/src/nextcloud/occ; \
rm -rf "$GNUPGHOME" /var/www/html/updater; \
mkdir -p /var/www/html/data; \
mkdir -p /var/www/html/custom_apps; \
mkdir -p /var/www/html/themes; \
chmod +x /var/www/html/occ; \
apk del --no-network .fetch-deps
COPY *.sh upgrade.exclude /

View File

@ -131,7 +131,11 @@ RUN { \
chown -R www-data:root /var/www; \
chmod -R g=u /var/www
VOLUME /var/www/html
VOLUME /var/www/html/data
VOLUME /var/www/html/config
VOLUME /var/www/html/custom_apps
VOLUME /var/www/html/themes
VOLUME /var/www/tmp
%%VARIANT_EXTRAS%%
ENV NEXTCLOUD_VERSION %%VERSION%%
@ -151,12 +155,17 @@ RUN set -ex; \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
tar -xjf nextcloud.tar.bz2 -C /usr/src/; \
mkdir /usr/src/nextcloud-base; \
mv -vf /usr/src/nextcloud/config /usr/src/nextcloud/themes /usr/src/nextcloud-base/; \
rm -Rvf /var/www/html; \
mv -vf /usr/src/nextcloud /var/www/html; \
mv -vf /usr/src/nextcloud-base /usr/src/nextcloud; \
gpgconf --kill all; \
rm nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
rm -rf "$GNUPGHOME" /usr/src/nextcloud/updater; \
mkdir -p /usr/src/nextcloud/data; \
mkdir -p /usr/src/nextcloud/custom_apps; \
chmod +x /usr/src/nextcloud/occ; \
rm -rf "$GNUPGHOME" /var/www/html/updater; \
mkdir -p /var/www/html/data; \
mkdir -p /var/www/html/custom_apps; \
mkdir -p /var/www/html/themes; \
chmod +x /var/www/html/occ; \
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \
apt-get dist-clean

View File

@ -157,12 +157,12 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi
installed_version="0.0.0.0"
if [ -f /var/www/html/version.php ]; then
if [ -f /var/www/html/config/version.php ]; then
# shellcheck disable=SC2016
installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
installed_version="$(php -r 'require "/var/www/html/config/version.php"; echo implode(".", $OC_Version);')"
fi
# shellcheck disable=SC2016
image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')"
image_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
if version_greater "$installed_version" "$image_version"; then
echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?"
@ -186,13 +186,11 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
rsync_options="-rlD"
fi
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
rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/
fi
done
rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/
# Install
if [ "$installed_version" = "0.0.0.0" ]; then
@ -284,6 +282,9 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
run_path post-upgrade
fi
cp -vf /var/www/html/version.php /var/www/html/config/
chown -c $user:$group /var/www/html/config/version.php
echo "Initializing finished"
fi