Skip to content

Commit 4efd1f2

Browse files
committed
Run update.sh
1 parent 62254a5 commit 4efd1f2

File tree

12 files changed

+126
-66
lines changed

12 files changed

+126
-66
lines changed

31/apache/Dockerfile

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,11 @@ RUN { \
132132
chown -R www-data:root /var/www; \
133133
chmod -R g=u /var/www
134134

135-
VOLUME /var/www/html
135+
VOLUME /var/www/html/data
136+
VOLUME /var/www/html/config
137+
VOLUME /var/www/html/custom_apps
138+
VOLUME /var/www/html/themes
139+
VOLUME /var/www/tmp
136140

137141
RUN a2enmod headers rewrite remoteip ; \
138142
{ \
@@ -167,12 +171,17 @@ RUN set -ex; \
167171
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
168172
gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
169173
tar -xjf nextcloud.tar.bz2 -C /usr/src/; \
174+
mkdir /usr/src/nextcloud-base; \
175+
mv -vf /usr/src/nextcloud/config /usr/src/nextcloud/themes /usr/src/nextcloud-base/; \
176+
rm -Rvf /var/www/html; \
177+
mv -vf /usr/src/nextcloud /var/www/html; \
178+
mv -vf /usr/src/nextcloud-base /usr/src/nextcloud; \
170179
gpgconf --kill all; \
171-
rm nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
172-
rm -rf "$GNUPGHOME" /usr/src/nextcloud/updater; \
173-
mkdir -p /usr/src/nextcloud/data; \
174-
mkdir -p /usr/src/nextcloud/custom_apps; \
175-
chmod +x /usr/src/nextcloud/occ; \
180+
rm -rf "$GNUPGHOME" /var/www/html/updater; \
181+
mkdir -p /var/www/html/data; \
182+
mkdir -p /var/www/html/custom_apps; \
183+
mkdir -p /var/www/html/themes; \
184+
chmod +x /var/www/html/occ; \
176185
\
177186
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \
178187
apt-get dist-clean

31/apache/entrypoint.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,12 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
157157
fi
158158

159159
installed_version="0.0.0.0"
160-
if [ -f /var/www/html/version.php ]; then
160+
if [ -f /var/www/html/config/version.php ]; then
161161
# shellcheck disable=SC2016
162-
installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
162+
installed_version="$(php -r 'require "/var/www/html/config/version.php"; echo implode(".", $OC_Version);')"
163163
fi
164164
# shellcheck disable=SC2016
165-
image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')"
165+
image_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
166166

167167
if version_greater "$installed_version" "$image_version"; then
168168
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
186186
rsync_options="-rlD"
187187
fi
188188

189-
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
190189
for dir in config data custom_apps themes; do
191190
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
192191
rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/
193192
fi
194193
done
195-
rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/
196194

197195
# Install
198196
if [ "$installed_version" = "0.0.0.0" ]; then
@@ -284,6 +282,9 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
284282
run_path post-upgrade
285283
fi
286284

285+
cp -vf /var/www/html/version.php /var/www/html/config/
286+
chown -c $user:$group /var/www/html/config/version.php
287+
287288
echo "Initializing finished"
288289
fi
289290

31/fpm-alpine/Dockerfile

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,11 @@ RUN { \
125125
chown -R www-data:root /var/www; \
126126
chmod -R g=u /var/www
127127

128-
VOLUME /var/www/html
128+
VOLUME /var/www/html/data
129+
VOLUME /var/www/html/config
130+
VOLUME /var/www/html/custom_apps
131+
VOLUME /var/www/html/themes
132+
VOLUME /var/www/tmp
129133

130134

131135
ENV NEXTCLOUD_VERSION 31.0.11
@@ -143,12 +147,17 @@ RUN set -ex; \
143147
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
144148
gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
145149
tar -xjf nextcloud.tar.bz2 -C /usr/src/; \
150+
mkdir /usr/src/nextcloud-base; \
151+
mv -vf /usr/src/nextcloud/config /usr/src/nextcloud/themes /usr/src/nextcloud-base/; \
152+
rm -Rvf /var/www/html; \
153+
mv -vf /usr/src/nextcloud /var/www/html; \
154+
mv -vf /usr/src/nextcloud-base /usr/src/nextcloud; \
146155
gpgconf --kill all; \
147-
rm nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
148-
rm -rf "$GNUPGHOME" /usr/src/nextcloud/updater; \
149-
mkdir -p /usr/src/nextcloud/data; \
150-
mkdir -p /usr/src/nextcloud/custom_apps; \
151-
chmod +x /usr/src/nextcloud/occ; \
156+
rm -rf "$GNUPGHOME" /var/www/html/updater; \
157+
mkdir -p /var/www/html/data; \
158+
mkdir -p /var/www/html/custom_apps; \
159+
mkdir -p /var/www/html/themes; \
160+
chmod +x /var/www/html/occ; \
152161
apk del --no-network .fetch-deps
153162

154163
COPY *.sh upgrade.exclude /

31/fpm-alpine/entrypoint.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,12 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
157157
fi
158158

159159
installed_version="0.0.0.0"
160-
if [ -f /var/www/html/version.php ]; then
160+
if [ -f /var/www/html/config/version.php ]; then
161161
# shellcheck disable=SC2016
162-
installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
162+
installed_version="$(php -r 'require "/var/www/html/config/version.php"; echo implode(".", $OC_Version);')"
163163
fi
164164
# shellcheck disable=SC2016
165-
image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')"
165+
image_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
166166

167167
if version_greater "$installed_version" "$image_version"; then
168168
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
186186
rsync_options="-rlD"
187187
fi
188188

189-
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
190189
for dir in config data custom_apps themes; do
191190
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
192191
rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/
193192
fi
194193
done
195-
rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/
196194

197195
# Install
198196
if [ "$installed_version" = "0.0.0.0" ]; then
@@ -284,6 +282,9 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
284282
run_path post-upgrade
285283
fi
286284

285+
cp -vf /var/www/html/version.php /var/www/html/config/
286+
chown -c $user:$group /var/www/html/config/version.php
287+
287288
echo "Initializing finished"
288289
fi
289290

31/fpm/Dockerfile

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,11 @@ RUN { \
132132
chown -R www-data:root /var/www; \
133133
chmod -R g=u /var/www
134134

135-
VOLUME /var/www/html
135+
VOLUME /var/www/html/data
136+
VOLUME /var/www/html/config
137+
VOLUME /var/www/html/custom_apps
138+
VOLUME /var/www/html/themes
139+
VOLUME /var/www/tmp
136140

137141

138142
ENV NEXTCLOUD_VERSION 31.0.11
@@ -152,12 +156,17 @@ RUN set -ex; \
152156
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
153157
gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
154158
tar -xjf nextcloud.tar.bz2 -C /usr/src/; \
159+
mkdir /usr/src/nextcloud-base; \
160+
mv -vf /usr/src/nextcloud/config /usr/src/nextcloud/themes /usr/src/nextcloud-base/; \
161+
rm -Rvf /var/www/html; \
162+
mv -vf /usr/src/nextcloud /var/www/html; \
163+
mv -vf /usr/src/nextcloud-base /usr/src/nextcloud; \
155164
gpgconf --kill all; \
156-
rm nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
157-
rm -rf "$GNUPGHOME" /usr/src/nextcloud/updater; \
158-
mkdir -p /usr/src/nextcloud/data; \
159-
mkdir -p /usr/src/nextcloud/custom_apps; \
160-
chmod +x /usr/src/nextcloud/occ; \
165+
rm -rf "$GNUPGHOME" /var/www/html/updater; \
166+
mkdir -p /var/www/html/data; \
167+
mkdir -p /var/www/html/custom_apps; \
168+
mkdir -p /var/www/html/themes; \
169+
chmod +x /var/www/html/occ; \
161170
\
162171
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \
163172
apt-get dist-clean

31/fpm/entrypoint.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,12 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
157157
fi
158158

159159
installed_version="0.0.0.0"
160-
if [ -f /var/www/html/version.php ]; then
160+
if [ -f /var/www/html/config/version.php ]; then
161161
# shellcheck disable=SC2016
162-
installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
162+
installed_version="$(php -r 'require "/var/www/html/config/version.php"; echo implode(".", $OC_Version);')"
163163
fi
164164
# shellcheck disable=SC2016
165-
image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')"
165+
image_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
166166

167167
if version_greater "$installed_version" "$image_version"; then
168168
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
186186
rsync_options="-rlD"
187187
fi
188188

189-
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
190189
for dir in config data custom_apps themes; do
191190
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
192191
rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/
193192
fi
194193
done
195-
rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/
196194

197195
# Install
198196
if [ "$installed_version" = "0.0.0.0" ]; then
@@ -284,6 +282,9 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
284282
run_path post-upgrade
285283
fi
286284

285+
cp -vf /var/www/html/version.php /var/www/html/config/
286+
chown -c $user:$group /var/www/html/config/version.php
287+
287288
echo "Initializing finished"
288289
fi
289290

32/apache/Dockerfile

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,11 @@ RUN { \
132132
chown -R www-data:root /var/www; \
133133
chmod -R g=u /var/www
134134

135-
VOLUME /var/www/html
135+
VOLUME /var/www/html/data
136+
VOLUME /var/www/html/config
137+
VOLUME /var/www/html/custom_apps
138+
VOLUME /var/www/html/themes
139+
VOLUME /var/www/tmp
136140

137141
RUN a2enmod headers rewrite remoteip ; \
138142
{ \
@@ -167,12 +171,17 @@ RUN set -ex; \
167171
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
168172
gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
169173
tar -xjf nextcloud.tar.bz2 -C /usr/src/; \
174+
mkdir /usr/src/nextcloud-base; \
175+
mv -vf /usr/src/nextcloud/config /usr/src/nextcloud/themes /usr/src/nextcloud-base/; \
176+
rm -Rvf /var/www/html; \
177+
mv -vf /usr/src/nextcloud /var/www/html; \
178+
mv -vf /usr/src/nextcloud-base /usr/src/nextcloud; \
170179
gpgconf --kill all; \
171-
rm nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
172-
rm -rf "$GNUPGHOME" /usr/src/nextcloud/updater; \
173-
mkdir -p /usr/src/nextcloud/data; \
174-
mkdir -p /usr/src/nextcloud/custom_apps; \
175-
chmod +x /usr/src/nextcloud/occ; \
180+
rm -rf "$GNUPGHOME" /var/www/html/updater; \
181+
mkdir -p /var/www/html/data; \
182+
mkdir -p /var/www/html/custom_apps; \
183+
mkdir -p /var/www/html/themes; \
184+
chmod +x /var/www/html/occ; \
176185
\
177186
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \
178187
apt-get dist-clean

32/apache/entrypoint.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,12 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
157157
fi
158158

159159
installed_version="0.0.0.0"
160-
if [ -f /var/www/html/version.php ]; then
160+
if [ -f /var/www/html/config/version.php ]; then
161161
# shellcheck disable=SC2016
162-
installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
162+
installed_version="$(php -r 'require "/var/www/html/config/version.php"; echo implode(".", $OC_Version);')"
163163
fi
164164
# shellcheck disable=SC2016
165-
image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')"
165+
image_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
166166

167167
if version_greater "$installed_version" "$image_version"; then
168168
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
186186
rsync_options="-rlD"
187187
fi
188188

189-
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
190189
for dir in config data custom_apps themes; do
191190
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
192191
rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/
193192
fi
194193
done
195-
rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/
196194

197195
# Install
198196
if [ "$installed_version" = "0.0.0.0" ]; then
@@ -284,6 +282,9 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
284282
run_path post-upgrade
285283
fi
286284

285+
cp -vf /var/www/html/version.php /var/www/html/config/
286+
chown -c $user:$group /var/www/html/config/version.php
287+
287288
echo "Initializing finished"
288289
fi
289290

32/fpm-alpine/Dockerfile

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,11 @@ RUN { \
125125
chown -R www-data:root /var/www; \
126126
chmod -R g=u /var/www
127127

128-
VOLUME /var/www/html
128+
VOLUME /var/www/html/data
129+
VOLUME /var/www/html/config
130+
VOLUME /var/www/html/custom_apps
131+
VOLUME /var/www/html/themes
132+
VOLUME /var/www/tmp
129133

130134

131135
ENV NEXTCLOUD_VERSION 32.0.2
@@ -143,12 +147,17 @@ RUN set -ex; \
143147
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
144148
gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
145149
tar -xjf nextcloud.tar.bz2 -C /usr/src/; \
150+
mkdir /usr/src/nextcloud-base; \
151+
mv -vf /usr/src/nextcloud/config /usr/src/nextcloud/themes /usr/src/nextcloud-base/; \
152+
rm -Rvf /var/www/html; \
153+
mv -vf /usr/src/nextcloud /var/www/html; \
154+
mv -vf /usr/src/nextcloud-base /usr/src/nextcloud; \
146155
gpgconf --kill all; \
147-
rm nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
148-
rm -rf "$GNUPGHOME" /usr/src/nextcloud/updater; \
149-
mkdir -p /usr/src/nextcloud/data; \
150-
mkdir -p /usr/src/nextcloud/custom_apps; \
151-
chmod +x /usr/src/nextcloud/occ; \
156+
rm -rf "$GNUPGHOME" /var/www/html/updater; \
157+
mkdir -p /var/www/html/data; \
158+
mkdir -p /var/www/html/custom_apps; \
159+
mkdir -p /var/www/html/themes; \
160+
chmod +x /var/www/html/occ; \
152161
apk del --no-network .fetch-deps
153162

154163
COPY *.sh upgrade.exclude /

32/fpm-alpine/entrypoint.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,12 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
157157
fi
158158

159159
installed_version="0.0.0.0"
160-
if [ -f /var/www/html/version.php ]; then
160+
if [ -f /var/www/html/config/version.php ]; then
161161
# shellcheck disable=SC2016
162-
installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
162+
installed_version="$(php -r 'require "/var/www/html/config/version.php"; echo implode(".", $OC_Version);')"
163163
fi
164164
# shellcheck disable=SC2016
165-
image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')"
165+
image_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
166166

167167
if version_greater "$installed_version" "$image_version"; then
168168
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
186186
rsync_options="-rlD"
187187
fi
188188

189-
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
190189
for dir in config data custom_apps themes; do
191190
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
192191
rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/
193192
fi
194193
done
195-
rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/
196194

197195
# Install
198196
if [ "$installed_version" = "0.0.0.0" ]; then
@@ -284,6 +282,9 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
284282
run_path post-upgrade
285283
fi
286284

285+
cp -vf /var/www/html/version.php /var/www/html/config/
286+
chown -c $user:$group /var/www/html/config/version.php
287+
287288
echo "Initializing finished"
288289
fi
289290

0 commit comments

Comments
 (0)