From 22de97f206a74a931c6e25439bf18ada178e990b Mon Sep 17 00:00:00 2001 From: J0WI Date: Sun, 11 Feb 2018 02:58:17 +0100 Subject: [PATCH 01/13] Add Alpine variant --- .travis.yml | 8 +- 11.0/fpm-alpine/Dockerfile | 111 ++++++++++++++++++ 11.0/fpm-alpine/config/apcu.config.php | 4 + 11.0/fpm-alpine/config/apps.config.php | 15 +++ 11.0/fpm-alpine/config/autoconfig.php | 34 ++++++ 11.0/fpm-alpine/cron.sh | 4 + 11.0/fpm-alpine/entrypoint.sh | 60 ++++++++++ 12.0/fpm-alpine/Dockerfile | 111 ++++++++++++++++++ 12.0/fpm-alpine/config/apcu.config.php | 4 + 12.0/fpm-alpine/config/apps.config.php | 15 +++ 12.0/fpm-alpine/config/autoconfig.php | 34 ++++++ 12.0/fpm-alpine/cron.sh | 4 + 12.0/fpm-alpine/entrypoint.sh | 60 ++++++++++ 13.0/fpm-alpine/Dockerfile | 111 ++++++++++++++++++ 13.0/fpm-alpine/config/apcu.config.php | 4 + 13.0/fpm-alpine/config/apps.config.php | 15 +++ 13.0/fpm-alpine/config/autoconfig.php | 34 ++++++ 13.0/fpm-alpine/cron.sh | 4 + 13.0/fpm-alpine/entrypoint.sh | 60 ++++++++++ Dockerfile-alpine.template | 111 ++++++++++++++++++ ...ile.template => Dockerfile-debian.template | 0 update.sh | 12 +- 22 files changed, 812 insertions(+), 3 deletions(-) create mode 100644 11.0/fpm-alpine/Dockerfile create mode 100644 11.0/fpm-alpine/config/apcu.config.php create mode 100644 11.0/fpm-alpine/config/apps.config.php create mode 100644 11.0/fpm-alpine/config/autoconfig.php create mode 100755 11.0/fpm-alpine/cron.sh create mode 100755 11.0/fpm-alpine/entrypoint.sh create mode 100644 12.0/fpm-alpine/Dockerfile create mode 100644 12.0/fpm-alpine/config/apcu.config.php create mode 100644 12.0/fpm-alpine/config/apps.config.php create mode 100644 12.0/fpm-alpine/config/autoconfig.php create mode 100755 12.0/fpm-alpine/cron.sh create mode 100755 12.0/fpm-alpine/entrypoint.sh create mode 100644 13.0/fpm-alpine/Dockerfile create mode 100644 13.0/fpm-alpine/config/apcu.config.php create mode 100644 13.0/fpm-alpine/config/apps.config.php create mode 100644 13.0/fpm-alpine/config/autoconfig.php create mode 100755 13.0/fpm-alpine/cron.sh create mode 100755 13.0/fpm-alpine/entrypoint.sh create mode 100644 Dockerfile-alpine.template rename Dockerfile.template => Dockerfile-debian.template (100%) diff --git a/.travis.yml b/.travis.yml index daeeae55e..d3b42b2e9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,14 +46,20 @@ jobs: - ./generate-stackbrew-library.sh - stage: test images - env: VERSION=11.0 VARIANT=fpm ARCH=amd64 + env: VERSION=11.0 VARIANT=fpm-alpine ARCH=amd64 + - env: VERSION=11.0 VARIANT=fpm-alpine ARCH=i386 + - env: VERSION=11.0 VARIANT=fpm ARCH=amd64 - env: VERSION=11.0 VARIANT=fpm ARCH=i386 - env: VERSION=11.0 VARIANT=apache ARCH=amd64 - env: VERSION=11.0 VARIANT=apache ARCH=i386 + - env: VERSION=12.0 VARIANT=fpm-alpine ARCH=amd64 + - env: VERSION=12.0 VARIANT=fpm-alpine ARCH=i386 - env: VERSION=12.0 VARIANT=fpm ARCH=amd64 - env: VERSION=12.0 VARIANT=fpm ARCH=i386 - env: VERSION=12.0 VARIANT=apache ARCH=amd64 - env: VERSION=12.0 VARIANT=apache ARCH=i386 + - env: VERSION=13.0 VARIANT=fpm-alpine ARCH=amd64 + - env: VERSION=13.0 VARIANT=fpm-alpine ARCH=i386 - env: VERSION=13.0 VARIANT=fpm ARCH=amd64 - env: VERSION=13.0 VARIANT=fpm ARCH=i386 - env: VERSION=13.0 VARIANT=apache ARCH=amd64 diff --git a/11.0/fpm-alpine/Dockerfile b/11.0/fpm-alpine/Dockerfile new file mode 100644 index 000000000..249974222 --- /dev/null +++ b/11.0/fpm-alpine/Dockerfile @@ -0,0 +1,111 @@ +FROM php:7.1-fpm-alpine + +# entrypoint.sh dependencies +RUN apk add --no-cache \ + bash \ + coreutils \ + rsync + +# install the PHP extensions we need +# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ + \ + apk add --no-cache --virtual .build-deps \ + alpine-sdk \ + autoconf \ + freetype-dev \ + icu-dev \ + libjpeg-turbo-dev \ + libmcrypt-dev \ + libpng-dev \ + libmemcached-dev \ + libxml2-dev \ + openldap-dev \ + postgresql-dev \ + ; \ + \ + docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ + docker-php-ext-configure ldap; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + mbstring \ + mcrypt \ + mysqli \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + pgsql \ + zip \ + ; \ + pecl install \ + APCu-5.1.9 \ + memcached-3.0.4 \ + redis-3.1.6 \ + ; \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + ; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --virtual .nextcloud-phpext-rundeps $runDeps; \ + apk del .build-deps + +# set recommended PHP.ini settings +# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache +RUN { \ + echo 'opcache.enable=1'; \ + echo 'opcache.enable_cli=1'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=10000'; \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.save_comments=1'; \ + echo 'opcache.revalidate_freq=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ + \ + chown -R www-data:root /var/www/html; \ + chmod -R g=u /var/www/html + +VOLUME /var/www/html + + +ENV NEXTCLOUD_VERSION 11.0.7 + +RUN set -ex; \ + apk add --no-cache --virtual .fetch-deps \ + bzip2 \ + gnupg \ + ; \ + \ + curl -fsSL -o nextcloud.tar.bz2 \ + "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ + curl -fsSL -o nextcloud.tar.bz2.asc \ + "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ +# gpg key from https://nextcloud.com/nextcloud.asc + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ + gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc; \ + tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ + rm nextcloud.tar.bz2; \ + rm -rf /usr/src/nextcloud/updater; \ + mkdir -p /usr/src/nextcloud/data; \ + mkdir -p /usr/src/nextcloud/custom_apps; \ + chmod +x /usr/src/nextcloud/occ; \ + apk del .fetch-deps + +COPY entrypoint.sh / +COPY config/* /usr/src/nextcloud/config/ + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["php-fpm"] diff --git a/11.0/fpm-alpine/config/apcu.config.php b/11.0/fpm-alpine/config/apcu.config.php new file mode 100644 index 000000000..69fed876a --- /dev/null +++ b/11.0/fpm-alpine/config/apcu.config.php @@ -0,0 +1,4 @@ + '\OC\Memcache\APCu', +); diff --git a/11.0/fpm-alpine/config/apps.config.php b/11.0/fpm-alpine/config/apps.config.php new file mode 100644 index 000000000..a4bed8336 --- /dev/null +++ b/11.0/fpm-alpine/config/apps.config.php @@ -0,0 +1,15 @@ + array ( + 0 => array ( + "path" => OC::$SERVERROOT."/apps", + "url" => "/apps", + "writable" => false, + ), + 1 => array ( + "path" => OC::$SERVERROOT."/custom_apps", + "url" => "/custom_apps", + "writable" => true, + ), + ), +); diff --git a/11.0/fpm-alpine/config/autoconfig.php b/11.0/fpm-alpine/config/autoconfig.php new file mode 100644 index 000000000..b759f4d1a --- /dev/null +++ b/11.0/fpm-alpine/config/autoconfig.php @@ -0,0 +1,34 @@ + B +function version_greater() { + [[ "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1" ]]; +} + +# return true if specified directory is empty +function directory_empty() { + [ -n "$(find "$1"/ -prune -empty)" ] +} + +function run_as() { + if [[ $EUID -eq 0 ]]; then + su - www-data -s /bin/bash -c "$1" + else + bash -c "$1" + fi +} + +installed_version="0.0.0~unknown" +if [ -f /var/www/html/version.php ]; then + installed_version=$(php -r 'require "/var/www/html/version.php"; echo "$OC_VersionString";') +fi +image_version=$(php -r 'require "/usr/src/nextcloud/version.php"; echo "$OC_VersionString";') + +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?" + exit 1 +fi + +if version_greater "$image_version" "$installed_version"; then + if [ "$installed_version" != "0.0.0~unknown" ]; then + run_as 'php /var/www/html/occ app:list' > /tmp/list_before + fi + if [[ $EUID -eq 0 ]]; then + rsync_options="-rlDog --chown www-data:root" + else + rsync_options="-rlD" + fi + rsync $rsync_options --delete --exclude /config/ --exclude /data/ --exclude /custom_apps/ --exclude /themes/ /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 + + if [ "$installed_version" != "0.0.0~unknown" ]; then + run_as 'php /var/www/html/occ upgrade --no-app-disable' + + run_as 'php /var/www/html/occ app:list' > /tmp/list_after + echo "The following apps have beed disabled:" + diff <(sed -n "/Enabled:/,/Disabled:/p" /tmp/list_before) <(sed -n "/Enabled:/,/Disabled:/p" /tmp/list_after) | grep '<' | cut -d- -f2 | cut -d: -f1 + rm -f /tmp/list_before /tmp/list_after + fi +fi + +exec "$@" diff --git a/12.0/fpm-alpine/Dockerfile b/12.0/fpm-alpine/Dockerfile new file mode 100644 index 000000000..1b039c5d3 --- /dev/null +++ b/12.0/fpm-alpine/Dockerfile @@ -0,0 +1,111 @@ +FROM php:7.1-fpm-alpine + +# entrypoint.sh dependencies +RUN apk add --no-cache \ + bash \ + coreutils \ + rsync + +# install the PHP extensions we need +# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ + \ + apk add --no-cache --virtual .build-deps \ + alpine-sdk \ + autoconf \ + freetype-dev \ + icu-dev \ + libjpeg-turbo-dev \ + libmcrypt-dev \ + libpng-dev \ + libmemcached-dev \ + libxml2-dev \ + openldap-dev \ + postgresql-dev \ + ; \ + \ + docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ + docker-php-ext-configure ldap; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + mbstring \ + mcrypt \ + mysqli \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + pgsql \ + zip \ + ; \ + pecl install \ + APCu-5.1.9 \ + memcached-3.0.4 \ + redis-3.1.6 \ + ; \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + ; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --virtual .nextcloud-phpext-rundeps $runDeps; \ + apk del .build-deps + +# set recommended PHP.ini settings +# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache +RUN { \ + echo 'opcache.enable=1'; \ + echo 'opcache.enable_cli=1'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=10000'; \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.save_comments=1'; \ + echo 'opcache.revalidate_freq=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ + \ + chown -R www-data:root /var/www/html; \ + chmod -R g=u /var/www/html + +VOLUME /var/www/html + + +ENV NEXTCLOUD_VERSION 12.0.5 + +RUN set -ex; \ + apk add --no-cache --virtual .fetch-deps \ + bzip2 \ + gnupg \ + ; \ + \ + curl -fsSL -o nextcloud.tar.bz2 \ + "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ + curl -fsSL -o nextcloud.tar.bz2.asc \ + "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ +# gpg key from https://nextcloud.com/nextcloud.asc + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ + gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc; \ + tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ + rm nextcloud.tar.bz2; \ + rm -rf /usr/src/nextcloud/updater; \ + mkdir -p /usr/src/nextcloud/data; \ + mkdir -p /usr/src/nextcloud/custom_apps; \ + chmod +x /usr/src/nextcloud/occ; \ + apk del .fetch-deps + +COPY entrypoint.sh / +COPY config/* /usr/src/nextcloud/config/ + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["php-fpm"] diff --git a/12.0/fpm-alpine/config/apcu.config.php b/12.0/fpm-alpine/config/apcu.config.php new file mode 100644 index 000000000..69fed876a --- /dev/null +++ b/12.0/fpm-alpine/config/apcu.config.php @@ -0,0 +1,4 @@ + '\OC\Memcache\APCu', +); diff --git a/12.0/fpm-alpine/config/apps.config.php b/12.0/fpm-alpine/config/apps.config.php new file mode 100644 index 000000000..a4bed8336 --- /dev/null +++ b/12.0/fpm-alpine/config/apps.config.php @@ -0,0 +1,15 @@ + array ( + 0 => array ( + "path" => OC::$SERVERROOT."/apps", + "url" => "/apps", + "writable" => false, + ), + 1 => array ( + "path" => OC::$SERVERROOT."/custom_apps", + "url" => "/custom_apps", + "writable" => true, + ), + ), +); diff --git a/12.0/fpm-alpine/config/autoconfig.php b/12.0/fpm-alpine/config/autoconfig.php new file mode 100644 index 000000000..b759f4d1a --- /dev/null +++ b/12.0/fpm-alpine/config/autoconfig.php @@ -0,0 +1,34 @@ + B +function version_greater() { + [[ "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1" ]]; +} + +# return true if specified directory is empty +function directory_empty() { + [ -n "$(find "$1"/ -prune -empty)" ] +} + +function run_as() { + if [[ $EUID -eq 0 ]]; then + su - www-data -s /bin/bash -c "$1" + else + bash -c "$1" + fi +} + +installed_version="0.0.0~unknown" +if [ -f /var/www/html/version.php ]; then + installed_version=$(php -r 'require "/var/www/html/version.php"; echo "$OC_VersionString";') +fi +image_version=$(php -r 'require "/usr/src/nextcloud/version.php"; echo "$OC_VersionString";') + +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?" + exit 1 +fi + +if version_greater "$image_version" "$installed_version"; then + if [ "$installed_version" != "0.0.0~unknown" ]; then + run_as 'php /var/www/html/occ app:list' > /tmp/list_before + fi + if [[ $EUID -eq 0 ]]; then + rsync_options="-rlDog --chown www-data:root" + else + rsync_options="-rlD" + fi + rsync $rsync_options --delete --exclude /config/ --exclude /data/ --exclude /custom_apps/ --exclude /themes/ /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 + + if [ "$installed_version" != "0.0.0~unknown" ]; then + run_as 'php /var/www/html/occ upgrade --no-app-disable' + + run_as 'php /var/www/html/occ app:list' > /tmp/list_after + echo "The following apps have beed disabled:" + diff <(sed -n "/Enabled:/,/Disabled:/p" /tmp/list_before) <(sed -n "/Enabled:/,/Disabled:/p" /tmp/list_after) | grep '<' | cut -d- -f2 | cut -d: -f1 + rm -f /tmp/list_before /tmp/list_after + fi +fi + +exec "$@" diff --git a/13.0/fpm-alpine/Dockerfile b/13.0/fpm-alpine/Dockerfile new file mode 100644 index 000000000..36a5bef5b --- /dev/null +++ b/13.0/fpm-alpine/Dockerfile @@ -0,0 +1,111 @@ +FROM php:7.1-fpm-alpine + +# entrypoint.sh dependencies +RUN apk add --no-cache \ + bash \ + coreutils \ + rsync + +# install the PHP extensions we need +# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ + \ + apk add --no-cache --virtual .build-deps \ + alpine-sdk \ + autoconf \ + freetype-dev \ + icu-dev \ + libjpeg-turbo-dev \ + libmcrypt-dev \ + libpng-dev \ + libmemcached-dev \ + libxml2-dev \ + openldap-dev \ + postgresql-dev \ + ; \ + \ + docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ + docker-php-ext-configure ldap; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + mbstring \ + mcrypt \ + mysqli \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + pgsql \ + zip \ + ; \ + pecl install \ + APCu-5.1.9 \ + memcached-3.0.4 \ + redis-3.1.6 \ + ; \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + ; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --virtual .nextcloud-phpext-rundeps $runDeps; \ + apk del .build-deps + +# set recommended PHP.ini settings +# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache +RUN { \ + echo 'opcache.enable=1'; \ + echo 'opcache.enable_cli=1'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=10000'; \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.save_comments=1'; \ + echo 'opcache.revalidate_freq=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ + \ + chown -R www-data:root /var/www/html; \ + chmod -R g=u /var/www/html + +VOLUME /var/www/html + + +ENV NEXTCLOUD_VERSION 13.0.0 + +RUN set -ex; \ + apk add --no-cache --virtual .fetch-deps \ + bzip2 \ + gnupg \ + ; \ + \ + curl -fsSL -o nextcloud.tar.bz2 \ + "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ + curl -fsSL -o nextcloud.tar.bz2.asc \ + "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ +# gpg key from https://nextcloud.com/nextcloud.asc + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ + gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc; \ + tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ + rm nextcloud.tar.bz2; \ + rm -rf /usr/src/nextcloud/updater; \ + mkdir -p /usr/src/nextcloud/data; \ + mkdir -p /usr/src/nextcloud/custom_apps; \ + chmod +x /usr/src/nextcloud/occ; \ + apk del .fetch-deps + +COPY entrypoint.sh / +COPY config/* /usr/src/nextcloud/config/ + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["php-fpm"] diff --git a/13.0/fpm-alpine/config/apcu.config.php b/13.0/fpm-alpine/config/apcu.config.php new file mode 100644 index 000000000..69fed876a --- /dev/null +++ b/13.0/fpm-alpine/config/apcu.config.php @@ -0,0 +1,4 @@ + '\OC\Memcache\APCu', +); diff --git a/13.0/fpm-alpine/config/apps.config.php b/13.0/fpm-alpine/config/apps.config.php new file mode 100644 index 000000000..a4bed8336 --- /dev/null +++ b/13.0/fpm-alpine/config/apps.config.php @@ -0,0 +1,15 @@ + array ( + 0 => array ( + "path" => OC::$SERVERROOT."/apps", + "url" => "/apps", + "writable" => false, + ), + 1 => array ( + "path" => OC::$SERVERROOT."/custom_apps", + "url" => "/custom_apps", + "writable" => true, + ), + ), +); diff --git a/13.0/fpm-alpine/config/autoconfig.php b/13.0/fpm-alpine/config/autoconfig.php new file mode 100644 index 000000000..b759f4d1a --- /dev/null +++ b/13.0/fpm-alpine/config/autoconfig.php @@ -0,0 +1,34 @@ + B +function version_greater() { + [[ "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1" ]]; +} + +# return true if specified directory is empty +function directory_empty() { + [ -n "$(find "$1"/ -prune -empty)" ] +} + +function run_as() { + if [[ $EUID -eq 0 ]]; then + su - www-data -s /bin/bash -c "$1" + else + bash -c "$1" + fi +} + +installed_version="0.0.0~unknown" +if [ -f /var/www/html/version.php ]; then + installed_version=$(php -r 'require "/var/www/html/version.php"; echo "$OC_VersionString";') +fi +image_version=$(php -r 'require "/usr/src/nextcloud/version.php"; echo "$OC_VersionString";') + +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?" + exit 1 +fi + +if version_greater "$image_version" "$installed_version"; then + if [ "$installed_version" != "0.0.0~unknown" ]; then + run_as 'php /var/www/html/occ app:list' > /tmp/list_before + fi + if [[ $EUID -eq 0 ]]; then + rsync_options="-rlDog --chown www-data:root" + else + rsync_options="-rlD" + fi + rsync $rsync_options --delete --exclude /config/ --exclude /data/ --exclude /custom_apps/ --exclude /themes/ /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 + + if [ "$installed_version" != "0.0.0~unknown" ]; then + run_as 'php /var/www/html/occ upgrade --no-app-disable' + + run_as 'php /var/www/html/occ app:list' > /tmp/list_after + echo "The following apps have beed disabled:" + diff <(sed -n "/Enabled:/,/Disabled:/p" /tmp/list_before) <(sed -n "/Enabled:/,/Disabled:/p" /tmp/list_after) | grep '<' | cut -d- -f2 | cut -d: -f1 + rm -f /tmp/list_before /tmp/list_after + fi +fi + +exec "$@" diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template new file mode 100644 index 000000000..34be0e850 --- /dev/null +++ b/Dockerfile-alpine.template @@ -0,0 +1,111 @@ +FROM php:7.1-%%VARIANT%% + +# entrypoint.sh dependencies +RUN apk add --no-cache \ + bash \ + coreutils \ + rsync + +# install the PHP extensions we need +# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ + \ + apk add --no-cache --virtual .build-deps \ + alpine-sdk \ + autoconf \ + freetype-dev \ + icu-dev \ + libjpeg-turbo-dev \ + libmcrypt-dev \ + libpng-dev \ + libmemcached-dev \ + libxml2-dev \ + openldap-dev \ + postgresql-dev \ + ; \ + \ + docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ + docker-php-ext-configure ldap; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + mbstring \ + mcrypt \ + mysqli \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + pgsql \ + zip \ + ; \ + pecl install \ + APCu-5.1.9 \ + memcached-3.0.4 \ + redis-3.1.6 \ + ; \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + ; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --virtual .nextcloud-phpext-rundeps $runDeps; \ + apk del .build-deps + +# set recommended PHP.ini settings +# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache +RUN { \ + echo 'opcache.enable=1'; \ + echo 'opcache.enable_cli=1'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=10000'; \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.save_comments=1'; \ + echo 'opcache.revalidate_freq=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ + \ + chown -R www-data:root /var/www/html; \ + chmod -R g=u /var/www/html + +VOLUME /var/www/html +%%VARIANT_EXTRAS%% + +ENV NEXTCLOUD_VERSION %%VERSION%% + +RUN set -ex; \ + apk add --no-cache --virtual .fetch-deps \ + bzip2 \ + gnupg \ + ; \ + \ + curl -fsSL -o nextcloud.tar.bz2 \ + "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ + curl -fsSL -o nextcloud.tar.bz2.asc \ + "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ +# gpg key from https://nextcloud.com/nextcloud.asc + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ + gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc; \ + tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ + rm nextcloud.tar.bz2; \ + rm -rf /usr/src/nextcloud/updater; \ + mkdir -p /usr/src/nextcloud/data; \ + mkdir -p /usr/src/nextcloud/custom_apps; \ + chmod +x /usr/src/nextcloud/occ; \ + apk del .fetch-deps + +COPY entrypoint.sh / +COPY config/* /usr/src/nextcloud/config/ + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["%%CMD%%"] diff --git a/Dockerfile.template b/Dockerfile-debian.template similarity index 100% rename from Dockerfile.template rename to Dockerfile-debian.template diff --git a/update.sh b/update.sh index 2fb6f4c01..dfe2170f0 100755 --- a/update.sh +++ b/update.sh @@ -4,11 +4,19 @@ set -eo pipefail declare -A cmd=( [apache]='apache2-foreground' [fpm]='php-fpm' + [fpm-alpine]='php-fpm' +) + +declare -A base=( + [apache]='debian' + [fpm]='debian' + [fpm-alpine]='alpine' ) declare -A extras=( [apache]='\nRUN a2enmod rewrite' [fpm]='' + [fpm-alpine]='' ) # version_greater_or_equal A B returns whether A >= B @@ -34,11 +42,11 @@ for latest in "${latests[@]}"; do # Only add versions >= 11 if version_greater_or_equal "$version" "11.0"; then - for variant in apache fpm; do + for variant in apache fpm fpm-alpine; do # Create the version+variant directory with a Dockerfile. mkdir -p "$version/$variant" - template="Dockerfile.template" + template="Dockerfile-${base[$variant]}.template" cp "$template" "$version/$variant/Dockerfile" echo "updating $latest [$version] $variant" From bf2dc98496be77bf83c277219356fa807a4af7bc Mon Sep 17 00:00:00 2001 From: J0WI Date: Tue, 13 Feb 2018 00:52:25 +0100 Subject: [PATCH 02/13] Add pcre-dev to build-deps --- 11.0/fpm-alpine/Dockerfile | 1 + 12.0/fpm-alpine/Dockerfile | 1 + 13.0/fpm-alpine/Dockerfile | 1 + Dockerfile-alpine.template | 1 + 4 files changed, 4 insertions(+) diff --git a/11.0/fpm-alpine/Dockerfile b/11.0/fpm-alpine/Dockerfile index 249974222..21497f181 100644 --- a/11.0/fpm-alpine/Dockerfile +++ b/11.0/fpm-alpine/Dockerfile @@ -21,6 +21,7 @@ RUN set -ex; \ libmemcached-dev \ libxml2-dev \ openldap-dev \ + pcre-dev \ postgresql-dev \ ; \ \ diff --git a/12.0/fpm-alpine/Dockerfile b/12.0/fpm-alpine/Dockerfile index 1b039c5d3..d05709a88 100644 --- a/12.0/fpm-alpine/Dockerfile +++ b/12.0/fpm-alpine/Dockerfile @@ -21,6 +21,7 @@ RUN set -ex; \ libmemcached-dev \ libxml2-dev \ openldap-dev \ + pcre-dev \ postgresql-dev \ ; \ \ diff --git a/13.0/fpm-alpine/Dockerfile b/13.0/fpm-alpine/Dockerfile index 36a5bef5b..a83cd0d0a 100644 --- a/13.0/fpm-alpine/Dockerfile +++ b/13.0/fpm-alpine/Dockerfile @@ -21,6 +21,7 @@ RUN set -ex; \ libmemcached-dev \ libxml2-dev \ openldap-dev \ + pcre-dev \ postgresql-dev \ ; \ \ diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index 34be0e850..7594bcad7 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -21,6 +21,7 @@ RUN set -ex; \ libmemcached-dev \ libxml2-dev \ openldap-dev \ + pcre-dev \ postgresql-dev \ ; \ \ From 8281ad1663a0d65c4757615a137c408367531eb8 Mon Sep 17 00:00:00 2001 From: J0WI Date: Wed, 14 Feb 2018 01:19:07 +0100 Subject: [PATCH 03/13] Fix list of architectures for Apline --- .travis.yml | 5 +++-- generate-stackbrew-library.sh | 21 ++++++++++++++++++++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index d3b42b2e9..236f0900f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,8 +42,9 @@ jobs: - <<: *test-scripts env: SCRIPT=generate-stackbrew-library.sh - script: - - ./generate-stackbrew-library.sh + script: + # Only syntax check due bashbrew dependency + - bash -n generate-stackbrew-library.sh - stage: test images env: VERSION=11.0 VARIANT=fpm-alpine ARCH=amd64 diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh index da3fd6c06..453473ea1 100755 --- a/generate-stackbrew-library.sh +++ b/generate-stackbrew-library.sh @@ -25,6 +25,22 @@ dockerfileCommit() { ) } +getArches() { + local repo="$1"; shift + local officialImagesUrl='https://github.com/docker-library/official-images/raw/master/library/' + + eval "declare -g -A parentRepoToArches=( $( + find -name 'Dockerfile' -exec awk ' + toupper($1) == "FROM" && $2 !~ /^('"$repo"'|scratch|microsoft\/[^:]+)(:|$)/ { + print "'"$officialImagesUrl"'" $2 + } + ' '{}' + \ + | sort -u \ + | xargs bashbrew cat --format '[{{ .RepoName }}:{{ .TagName }}]="{{ join " " .TagEntry.Architectures }}"' + ) )" +} +getArches 'nextcloud' + # Header. cat <<-EOH # This file is generated via https://github.com/nextcloud/docker/blob/$(fileCommit "$self")/$self @@ -70,10 +86,13 @@ for version in "${versions[@]}"; do variantAliases+=( "${versionAliases[@]}" ) fi + variantParent="$(awk 'toupper($1) == "FROM" { print $2 }' "$version/$variant/Dockerfile")" + variantArches="${parentRepoToArches[$variantParent]}" + cat <<-EOE Tags: $(join ', ' "${variantAliases[@]}") - Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, ppc64le, s390x + Architectures: $(join ', ' $variantArches) GitCommit: $commit Directory: $version/$variant EOE From cca560535dee4789e7ea75cdaeb50fc1c08b0269 Mon Sep 17 00:00:00 2001 From: J0WI Date: Wed, 14 Feb 2018 02:44:38 +0100 Subject: [PATCH 04/13] Fix inclusion of Dockerfile examples --- generate-stackbrew-library.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh index 453473ea1..a32e8c950 100755 --- a/generate-stackbrew-library.sh +++ b/generate-stackbrew-library.sh @@ -30,7 +30,7 @@ getArches() { local officialImagesUrl='https://github.com/docker-library/official-images/raw/master/library/' eval "declare -g -A parentRepoToArches=( $( - find -name 'Dockerfile' -exec awk ' + find -maxdepth 3 -name 'Dockerfile' -exec awk ' toupper($1) == "FROM" && $2 !~ /^('"$repo"'|scratch|microsoft\/[^:]+)(:|$)/ { print "'"$officialImagesUrl"'" $2 } From 2e2b6bebd4b08345e449479480d8b0f344ddfe3b Mon Sep 17 00:00:00 2001 From: J0WI Date: Thu, 22 Feb 2018 17:54:37 +0100 Subject: [PATCH 05/13] Add bashbrew to Travis --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 236f0900f..b775fada9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,8 @@ branches: install: - git clone https://github.com/docker-library/official-images.git ~/official-images + - wget https://doi-janky.infosiftr.net/job/bashbrew/lastSuccessfulBuild/artifact/bin/bashbrew-amd64 + - export PATH=$PATH:$PWD before_script: - env | sort @@ -43,8 +45,7 @@ jobs: - <<: *test-scripts env: SCRIPT=generate-stackbrew-library.sh script: - # Only syntax check due bashbrew dependency - - bash -n generate-stackbrew-library.sh + - ./generate-stackbrew-library.sh - stage: test images env: VERSION=11.0 VARIANT=fpm-alpine ARCH=amd64 From 87cb4a6de8d83b6b53b1dc58fa92ebe0aaf87446 Mon Sep 17 00:00:00 2001 From: J0WI Date: Thu, 22 Feb 2018 18:00:14 +0100 Subject: [PATCH 06/13] Symlink to correct binary name --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b775fada9..5fcbcb2d3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ branches: install: - git clone https://github.com/docker-library/official-images.git ~/official-images - - wget https://doi-janky.infosiftr.net/job/bashbrew/lastSuccessfulBuild/artifact/bin/bashbrew-amd64 + - wget https://doi-janky.infosiftr.net/job/bashbrew/lastSuccessfulBuild/artifact/bin/bashbrew-amd64 && ln -s bashbrew-amd64 bashbrew - export PATH=$PATH:$PWD before_script: From 8bdcf4b0118f498bf858940c7d6e6e756745d26f Mon Sep 17 00:00:00 2001 From: J0WI Date: Thu, 22 Feb 2018 18:11:35 +0100 Subject: [PATCH 07/13] Backport #265 --- 11.0/fpm-alpine/Dockerfile | 2 +- 12.0/fpm-alpine/Dockerfile | 2 +- 13.0/fpm-alpine/Dockerfile | 2 +- Dockerfile-alpine.template | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/11.0/fpm-alpine/Dockerfile b/11.0/fpm-alpine/Dockerfile index 21497f181..ced5f91d1 100644 --- a/11.0/fpm-alpine/Dockerfile +++ b/11.0/fpm-alpine/Dockerfile @@ -43,7 +43,7 @@ RUN set -ex; \ zip \ ; \ pecl install \ - APCu-5.1.9 \ + APCu-5.1.10 \ memcached-3.0.4 \ redis-3.1.6 \ ; \ diff --git a/12.0/fpm-alpine/Dockerfile b/12.0/fpm-alpine/Dockerfile index d05709a88..c4471b4df 100644 --- a/12.0/fpm-alpine/Dockerfile +++ b/12.0/fpm-alpine/Dockerfile @@ -43,7 +43,7 @@ RUN set -ex; \ zip \ ; \ pecl install \ - APCu-5.1.9 \ + APCu-5.1.10 \ memcached-3.0.4 \ redis-3.1.6 \ ; \ diff --git a/13.0/fpm-alpine/Dockerfile b/13.0/fpm-alpine/Dockerfile index a83cd0d0a..7926dddbc 100644 --- a/13.0/fpm-alpine/Dockerfile +++ b/13.0/fpm-alpine/Dockerfile @@ -43,7 +43,7 @@ RUN set -ex; \ zip \ ; \ pecl install \ - APCu-5.1.9 \ + APCu-5.1.10 \ memcached-3.0.4 \ redis-3.1.6 \ ; \ diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index 7594bcad7..6304e8a22 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -43,7 +43,7 @@ RUN set -ex; \ zip \ ; \ pecl install \ - APCu-5.1.9 \ + APCu-5.1.10 \ memcached-3.0.4 \ redis-3.1.6 \ ; \ From ca29fd57aa46260b6711879ca40dff8cc650354b Mon Sep 17 00:00:00 2001 From: J0WI Date: Thu, 22 Feb 2018 18:20:13 +0100 Subject: [PATCH 08/13] Move bashbrew to before_script --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5fcbcb2d3..9af3dd92a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,10 +11,10 @@ branches: install: - git clone https://github.com/docker-library/official-images.git ~/official-images - - wget https://doi-janky.infosiftr.net/job/bashbrew/lastSuccessfulBuild/artifact/bin/bashbrew-amd64 && ln -s bashbrew-amd64 bashbrew - - export PATH=$PATH:$PWD before_script: + - wget https://doi-janky.infosiftr.net/job/bashbrew/lastSuccessfulBuild/artifact/bin/bashbrew-amd64 && ln -s bashbrew-amd64 bashbrew + - export PATH=$PATH:$PWD - env | sort - image="nextcloud:${VERSION}${VARIANT:+-$VARIANT}" - if [[ "$ARCH" == 'i386' ]]; then sed -i -e 's/FROM php/FROM i386\/php/g' "${VERSION}/${VARIANT}/Dockerfile"; fi From 1bcd0f4e00a39401ef463dde1d35f1fda73f1134 Mon Sep 17 00:00:00 2001 From: Tilo Spannagel Date: Fri, 23 Feb 2018 18:52:15 +0100 Subject: [PATCH 09/13] Fix bashbrew --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9af3dd92a..32e465cd1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,8 +13,6 @@ install: - git clone https://github.com/docker-library/official-images.git ~/official-images before_script: - - wget https://doi-janky.infosiftr.net/job/bashbrew/lastSuccessfulBuild/artifact/bin/bashbrew-amd64 && ln -s bashbrew-amd64 bashbrew - - export PATH=$PATH:$PWD - env | sort - image="nextcloud:${VERSION}${VARIANT:+-$VARIANT}" - if [[ "$ARCH" == 'i386' ]]; then sed -i -e 's/FROM php/FROM i386\/php/g' "${VERSION}/${VARIANT}/Dockerfile"; fi @@ -44,6 +42,9 @@ jobs: - <<: *test-scripts env: SCRIPT=generate-stackbrew-library.sh + install: + - wget -O "$HOME/bin/bashbrew" https://doi-janky.infosiftr.net/job/bashbrew/lastSuccessfulBuild/artifact/bin/bashbrew-amd64 + - chmod +x "$HOME/bin/bashbrew" script: - ./generate-stackbrew-library.sh From c4788d0867e002fd7e02d78a4b13e21cf74c8893 Mon Sep 17 00:00:00 2001 From: Tilo Spannagel Date: Tue, 27 Feb 2018 18:05:24 +0100 Subject: [PATCH 10/13] Add cron.sh to alpine --- 11.0/fpm-alpine/Dockerfile | 2 +- 12.0/fpm-alpine/Dockerfile | 2 +- 13.0/fpm-alpine/Dockerfile | 2 +- Dockerfile-alpine.template | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/11.0/fpm-alpine/Dockerfile b/11.0/fpm-alpine/Dockerfile index ced5f91d1..87ff9a7f7 100644 --- a/11.0/fpm-alpine/Dockerfile +++ b/11.0/fpm-alpine/Dockerfile @@ -105,7 +105,7 @@ RUN set -ex; \ chmod +x /usr/src/nextcloud/occ; \ apk del .fetch-deps -COPY entrypoint.sh / +COPY *.sh / COPY config/* /usr/src/nextcloud/config/ ENTRYPOINT ["/entrypoint.sh"] diff --git a/12.0/fpm-alpine/Dockerfile b/12.0/fpm-alpine/Dockerfile index c4471b4df..d0aa17731 100644 --- a/12.0/fpm-alpine/Dockerfile +++ b/12.0/fpm-alpine/Dockerfile @@ -105,7 +105,7 @@ RUN set -ex; \ chmod +x /usr/src/nextcloud/occ; \ apk del .fetch-deps -COPY entrypoint.sh / +COPY *.sh / COPY config/* /usr/src/nextcloud/config/ ENTRYPOINT ["/entrypoint.sh"] diff --git a/13.0/fpm-alpine/Dockerfile b/13.0/fpm-alpine/Dockerfile index 7926dddbc..35c34cd99 100644 --- a/13.0/fpm-alpine/Dockerfile +++ b/13.0/fpm-alpine/Dockerfile @@ -105,7 +105,7 @@ RUN set -ex; \ chmod +x /usr/src/nextcloud/occ; \ apk del .fetch-deps -COPY entrypoint.sh / +COPY *.sh / COPY config/* /usr/src/nextcloud/config/ ENTRYPOINT ["/entrypoint.sh"] diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index 6304e8a22..5097d9aff 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -105,7 +105,7 @@ RUN set -ex; \ chmod +x /usr/src/nextcloud/occ; \ apk del .fetch-deps -COPY entrypoint.sh / +COPY *.sh / COPY config/* /usr/src/nextcloud/config/ ENTRYPOINT ["/entrypoint.sh"] From e61317d3181fb0ff5bcb59f454f1563a9b9b8990 Mon Sep 17 00:00:00 2001 From: Tilo Spannagel Date: Tue, 27 Feb 2018 18:44:59 +0100 Subject: [PATCH 11/13] Setup cron --- 11.0/fpm-alpine/Dockerfile | 16 +++++++++++----- 12.0/fpm-alpine/Dockerfile | 16 +++++++++++----- 13.0/fpm-alpine/Dockerfile | 16 +++++++++++----- Dockerfile-alpine.template | 16 +++++++++++----- 4 files changed, 44 insertions(+), 20 deletions(-) diff --git a/11.0/fpm-alpine/Dockerfile b/11.0/fpm-alpine/Dockerfile index 87ff9a7f7..3a84692e4 100644 --- a/11.0/fpm-alpine/Dockerfile +++ b/11.0/fpm-alpine/Dockerfile @@ -1,10 +1,16 @@ FROM php:7.1-fpm-alpine -# entrypoint.sh dependencies -RUN apk add --no-cache \ - bash \ - coreutils \ - rsync +# entrypoint.sh and cron.sh dependencies +RUN set -ex; \ + \ + apk add --no-cache \ + bash \ + coreutils \ + rsync \ + ; \ + \ + mkdir -p /var/spool/cron/crontabs; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data # install the PHP extensions we need # see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html diff --git a/12.0/fpm-alpine/Dockerfile b/12.0/fpm-alpine/Dockerfile index d0aa17731..b58dbb576 100644 --- a/12.0/fpm-alpine/Dockerfile +++ b/12.0/fpm-alpine/Dockerfile @@ -1,10 +1,16 @@ FROM php:7.1-fpm-alpine -# entrypoint.sh dependencies -RUN apk add --no-cache \ - bash \ - coreutils \ - rsync +# entrypoint.sh and cron.sh dependencies +RUN set -ex; \ + \ + apk add --no-cache \ + bash \ + coreutils \ + rsync \ + ; \ + \ + mkdir -p /var/spool/cron/crontabs; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data # install the PHP extensions we need # see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html diff --git a/13.0/fpm-alpine/Dockerfile b/13.0/fpm-alpine/Dockerfile index 35c34cd99..0c430045e 100644 --- a/13.0/fpm-alpine/Dockerfile +++ b/13.0/fpm-alpine/Dockerfile @@ -1,10 +1,16 @@ FROM php:7.1-fpm-alpine -# entrypoint.sh dependencies -RUN apk add --no-cache \ - bash \ - coreutils \ - rsync +# entrypoint.sh and cron.sh dependencies +RUN set -ex; \ + \ + apk add --no-cache \ + bash \ + coreutils \ + rsync \ + ; \ + \ + mkdir -p /var/spool/cron/crontabs; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data # install the PHP extensions we need # see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index 5097d9aff..8fecc85fe 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -1,10 +1,16 @@ FROM php:7.1-%%VARIANT%% -# entrypoint.sh dependencies -RUN apk add --no-cache \ - bash \ - coreutils \ - rsync +# entrypoint.sh and cron.sh dependencies +RUN set -ex; \ + \ + apk add --no-cache \ + bash \ + coreutils \ + rsync \ + ; \ + \ + mkdir -p /var/spool/cron/crontabs; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data # install the PHP extensions we need # see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html From 7739cef929d800045689f489ac31ed4cc1ec4ef2 Mon Sep 17 00:00:00 2001 From: Tilo Spannagel Date: Tue, 27 Feb 2018 20:41:11 +0100 Subject: [PATCH 12/13] Adjust the debian images --- 11.0/apache/Dockerfile | 46 +++++++++++++++++++++++++++++--------- 11.0/fpm/Dockerfile | 46 +++++++++++++++++++++++++++++--------- 12.0/apache/Dockerfile | 46 +++++++++++++++++++++++++++++--------- 12.0/fpm/Dockerfile | 46 +++++++++++++++++++++++++++++--------- 13.0/apache/Dockerfile | 46 +++++++++++++++++++++++++++++--------- 13.0/fpm/Dockerfile | 46 +++++++++++++++++++++++++++++--------- Dockerfile-debian.template | 46 +++++++++++++++++++++++++++++--------- 7 files changed, 252 insertions(+), 70 deletions(-) diff --git a/11.0/apache/Dockerfile b/11.0/apache/Dockerfile index f39b9f68a..9f0dbf5d4 100644 --- a/11.0/apache/Dockerfile +++ b/11.0/apache/Dockerfile @@ -1,20 +1,26 @@ FROM php:7.1-apache +# entrypoint.sh and cron.sh dependencies RUN set -ex; \ + \ apt-get update; \ -# install the packages we need apt-get install -y --no-install-recommends \ rsync \ bzip2 \ busybox-static \ ; \ + rm -rf /var/lib/apt/lists/*; \ + \ mkdir -p /var/spool/cron/crontabs; \ - echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data + # install the PHP extensions we need # see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ \ savedAptMark="$(apt-mark showmanual)"; \ \ + apt-get update; \ apt-get install -y --no-install-recommends \ libcurl4-openssl-dev \ libfreetype6-dev \ @@ -31,11 +37,31 @@ RUN set -ex; \ debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ - docker-php-ext-install gd exif intl mbstring mcrypt ldap mysqli opcache pdo_mysql pdo_pgsql pgsql zip pcntl; \ - pecl install APCu-5.1.10; \ - pecl install memcached-3.0.4; \ - pecl install redis-3.1.6; \ - docker-php-ext-enable apcu redis memcached; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + mbstring \ + mcrypt \ + mysqli \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + pgsql \ + zip \ + ; \ + pecl install \ + APCu-5.1.10 \ + memcached-3.0.4 \ + redis-3.1.6 \ + ; \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + ; \ \ # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies apt-mark auto '.*' > /dev/null; \ @@ -49,11 +75,11 @@ RUN set -ex; \ | xargs -rt apt-mark manual; \ \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/*; \ - \ + rm -rf /var/lib/apt/lists/* + # set recommended PHP.ini settings # see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache - { \ +RUN { \ echo 'opcache.enable=1'; \ echo 'opcache.enable_cli=1'; \ echo 'opcache.interned_strings_buffer=8'; \ diff --git a/11.0/fpm/Dockerfile b/11.0/fpm/Dockerfile index f0a5a6f77..1ad54cb71 100644 --- a/11.0/fpm/Dockerfile +++ b/11.0/fpm/Dockerfile @@ -1,20 +1,26 @@ FROM php:7.1-fpm +# entrypoint.sh and cron.sh dependencies RUN set -ex; \ + \ apt-get update; \ -# install the packages we need apt-get install -y --no-install-recommends \ rsync \ bzip2 \ busybox-static \ ; \ + rm -rf /var/lib/apt/lists/*; \ + \ mkdir -p /var/spool/cron/crontabs; \ - echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data + # install the PHP extensions we need # see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ \ savedAptMark="$(apt-mark showmanual)"; \ \ + apt-get update; \ apt-get install -y --no-install-recommends \ libcurl4-openssl-dev \ libfreetype6-dev \ @@ -31,11 +37,31 @@ RUN set -ex; \ debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ - docker-php-ext-install gd exif intl mbstring mcrypt ldap mysqli opcache pdo_mysql pdo_pgsql pgsql zip pcntl; \ - pecl install APCu-5.1.10; \ - pecl install memcached-3.0.4; \ - pecl install redis-3.1.6; \ - docker-php-ext-enable apcu redis memcached; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + mbstring \ + mcrypt \ + mysqli \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + pgsql \ + zip \ + ; \ + pecl install \ + APCu-5.1.10 \ + memcached-3.0.4 \ + redis-3.1.6 \ + ; \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + ; \ \ # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies apt-mark auto '.*' > /dev/null; \ @@ -49,11 +75,11 @@ RUN set -ex; \ | xargs -rt apt-mark manual; \ \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/*; \ - \ + rm -rf /var/lib/apt/lists/* + # set recommended PHP.ini settings # see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache - { \ +RUN { \ echo 'opcache.enable=1'; \ echo 'opcache.enable_cli=1'; \ echo 'opcache.interned_strings_buffer=8'; \ diff --git a/12.0/apache/Dockerfile b/12.0/apache/Dockerfile index acb990fae..69aed2c15 100644 --- a/12.0/apache/Dockerfile +++ b/12.0/apache/Dockerfile @@ -1,20 +1,26 @@ FROM php:7.1-apache +# entrypoint.sh and cron.sh dependencies RUN set -ex; \ + \ apt-get update; \ -# install the packages we need apt-get install -y --no-install-recommends \ rsync \ bzip2 \ busybox-static \ ; \ + rm -rf /var/lib/apt/lists/*; \ + \ mkdir -p /var/spool/cron/crontabs; \ - echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data + # install the PHP extensions we need # see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ \ savedAptMark="$(apt-mark showmanual)"; \ \ + apt-get update; \ apt-get install -y --no-install-recommends \ libcurl4-openssl-dev \ libfreetype6-dev \ @@ -31,11 +37,31 @@ RUN set -ex; \ debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ - docker-php-ext-install gd exif intl mbstring mcrypt ldap mysqli opcache pdo_mysql pdo_pgsql pgsql zip pcntl; \ - pecl install APCu-5.1.10; \ - pecl install memcached-3.0.4; \ - pecl install redis-3.1.6; \ - docker-php-ext-enable apcu redis memcached; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + mbstring \ + mcrypt \ + mysqli \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + pgsql \ + zip \ + ; \ + pecl install \ + APCu-5.1.10 \ + memcached-3.0.4 \ + redis-3.1.6 \ + ; \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + ; \ \ # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies apt-mark auto '.*' > /dev/null; \ @@ -49,11 +75,11 @@ RUN set -ex; \ | xargs -rt apt-mark manual; \ \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/*; \ - \ + rm -rf /var/lib/apt/lists/* + # set recommended PHP.ini settings # see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache - { \ +RUN { \ echo 'opcache.enable=1'; \ echo 'opcache.enable_cli=1'; \ echo 'opcache.interned_strings_buffer=8'; \ diff --git a/12.0/fpm/Dockerfile b/12.0/fpm/Dockerfile index 225cf0187..4ac2d1170 100644 --- a/12.0/fpm/Dockerfile +++ b/12.0/fpm/Dockerfile @@ -1,20 +1,26 @@ FROM php:7.1-fpm +# entrypoint.sh and cron.sh dependencies RUN set -ex; \ + \ apt-get update; \ -# install the packages we need apt-get install -y --no-install-recommends \ rsync \ bzip2 \ busybox-static \ ; \ + rm -rf /var/lib/apt/lists/*; \ + \ mkdir -p /var/spool/cron/crontabs; \ - echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data + # install the PHP extensions we need # see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ \ savedAptMark="$(apt-mark showmanual)"; \ \ + apt-get update; \ apt-get install -y --no-install-recommends \ libcurl4-openssl-dev \ libfreetype6-dev \ @@ -31,11 +37,31 @@ RUN set -ex; \ debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ - docker-php-ext-install gd exif intl mbstring mcrypt ldap mysqli opcache pdo_mysql pdo_pgsql pgsql zip pcntl; \ - pecl install APCu-5.1.10; \ - pecl install memcached-3.0.4; \ - pecl install redis-3.1.6; \ - docker-php-ext-enable apcu redis memcached; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + mbstring \ + mcrypt \ + mysqli \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + pgsql \ + zip \ + ; \ + pecl install \ + APCu-5.1.10 \ + memcached-3.0.4 \ + redis-3.1.6 \ + ; \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + ; \ \ # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies apt-mark auto '.*' > /dev/null; \ @@ -49,11 +75,11 @@ RUN set -ex; \ | xargs -rt apt-mark manual; \ \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/*; \ - \ + rm -rf /var/lib/apt/lists/* + # set recommended PHP.ini settings # see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache - { \ +RUN { \ echo 'opcache.enable=1'; \ echo 'opcache.enable_cli=1'; \ echo 'opcache.interned_strings_buffer=8'; \ diff --git a/13.0/apache/Dockerfile b/13.0/apache/Dockerfile index 3008d22f3..ca993c8f0 100644 --- a/13.0/apache/Dockerfile +++ b/13.0/apache/Dockerfile @@ -1,20 +1,26 @@ FROM php:7.1-apache +# entrypoint.sh and cron.sh dependencies RUN set -ex; \ + \ apt-get update; \ -# install the packages we need apt-get install -y --no-install-recommends \ rsync \ bzip2 \ busybox-static \ ; \ + rm -rf /var/lib/apt/lists/*; \ + \ mkdir -p /var/spool/cron/crontabs; \ - echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data + # install the PHP extensions we need # see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ \ savedAptMark="$(apt-mark showmanual)"; \ \ + apt-get update; \ apt-get install -y --no-install-recommends \ libcurl4-openssl-dev \ libfreetype6-dev \ @@ -31,11 +37,31 @@ RUN set -ex; \ debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ - docker-php-ext-install gd exif intl mbstring mcrypt ldap mysqli opcache pdo_mysql pdo_pgsql pgsql zip pcntl; \ - pecl install APCu-5.1.10; \ - pecl install memcached-3.0.4; \ - pecl install redis-3.1.6; \ - docker-php-ext-enable apcu redis memcached; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + mbstring \ + mcrypt \ + mysqli \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + pgsql \ + zip \ + ; \ + pecl install \ + APCu-5.1.10 \ + memcached-3.0.4 \ + redis-3.1.6 \ + ; \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + ; \ \ # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies apt-mark auto '.*' > /dev/null; \ @@ -49,11 +75,11 @@ RUN set -ex; \ | xargs -rt apt-mark manual; \ \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/*; \ - \ + rm -rf /var/lib/apt/lists/* + # set recommended PHP.ini settings # see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache - { \ +RUN { \ echo 'opcache.enable=1'; \ echo 'opcache.enable_cli=1'; \ echo 'opcache.interned_strings_buffer=8'; \ diff --git a/13.0/fpm/Dockerfile b/13.0/fpm/Dockerfile index ece66af94..e8cc1a2a7 100644 --- a/13.0/fpm/Dockerfile +++ b/13.0/fpm/Dockerfile @@ -1,20 +1,26 @@ FROM php:7.1-fpm +# entrypoint.sh and cron.sh dependencies RUN set -ex; \ + \ apt-get update; \ -# install the packages we need apt-get install -y --no-install-recommends \ rsync \ bzip2 \ busybox-static \ ; \ + rm -rf /var/lib/apt/lists/*; \ + \ mkdir -p /var/spool/cron/crontabs; \ - echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data + # install the PHP extensions we need # see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ \ savedAptMark="$(apt-mark showmanual)"; \ \ + apt-get update; \ apt-get install -y --no-install-recommends \ libcurl4-openssl-dev \ libfreetype6-dev \ @@ -31,11 +37,31 @@ RUN set -ex; \ debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ - docker-php-ext-install gd exif intl mbstring mcrypt ldap mysqli opcache pdo_mysql pdo_pgsql pgsql zip pcntl; \ - pecl install APCu-5.1.10; \ - pecl install memcached-3.0.4; \ - pecl install redis-3.1.6; \ - docker-php-ext-enable apcu redis memcached; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + mbstring \ + mcrypt \ + mysqli \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + pgsql \ + zip \ + ; \ + pecl install \ + APCu-5.1.10 \ + memcached-3.0.4 \ + redis-3.1.6 \ + ; \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + ; \ \ # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies apt-mark auto '.*' > /dev/null; \ @@ -49,11 +75,11 @@ RUN set -ex; \ | xargs -rt apt-mark manual; \ \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/*; \ - \ + rm -rf /var/lib/apt/lists/* + # set recommended PHP.ini settings # see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache - { \ +RUN { \ echo 'opcache.enable=1'; \ echo 'opcache.enable_cli=1'; \ echo 'opcache.interned_strings_buffer=8'; \ diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template index 0326593d5..742f02278 100644 --- a/Dockerfile-debian.template +++ b/Dockerfile-debian.template @@ -1,20 +1,26 @@ FROM php:7.1-%%VARIANT%% +# entrypoint.sh and cron.sh dependencies RUN set -ex; \ + \ apt-get update; \ -# install the packages we need apt-get install -y --no-install-recommends \ rsync \ bzip2 \ busybox-static \ ; \ + rm -rf /var/lib/apt/lists/*; \ + \ mkdir -p /var/spool/cron/crontabs; \ - echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data; \ + echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data + # install the PHP extensions we need # see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html +RUN set -ex; \ \ savedAptMark="$(apt-mark showmanual)"; \ \ + apt-get update; \ apt-get install -y --no-install-recommends \ libcurl4-openssl-dev \ libfreetype6-dev \ @@ -31,11 +37,31 @@ RUN set -ex; \ debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ - docker-php-ext-install gd exif intl mbstring mcrypt ldap mysqli opcache pdo_mysql pdo_pgsql pgsql zip pcntl; \ - pecl install APCu-5.1.10; \ - pecl install memcached-3.0.4; \ - pecl install redis-3.1.6; \ - docker-php-ext-enable apcu redis memcached; \ + docker-php-ext-install \ + exif \ + gd \ + intl \ + ldap \ + mbstring \ + mcrypt \ + mysqli \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + pgsql \ + zip \ + ; \ + pecl install \ + APCu-5.1.10 \ + memcached-3.0.4 \ + redis-3.1.6 \ + ; \ + docker-php-ext-enable \ + apcu \ + memcached \ + redis \ + ; \ \ # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies apt-mark auto '.*' > /dev/null; \ @@ -49,11 +75,11 @@ RUN set -ex; \ | xargs -rt apt-mark manual; \ \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/*; \ - \ + rm -rf /var/lib/apt/lists/* + # set recommended PHP.ini settings # see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache - { \ +RUN { \ echo 'opcache.enable=1'; \ echo 'opcache.enable_cli=1'; \ echo 'opcache.interned_strings_buffer=8'; \ From 923f8c434dc702282edfe9eef135bb9f332a8105 Mon Sep 17 00:00:00 2001 From: Tilo Spannagel Date: Wed, 28 Feb 2018 21:13:12 +0100 Subject: [PATCH 13/13] Remove the root cron file --- 11.0/fpm-alpine/Dockerfile | 2 +- 12.0/fpm-alpine/Dockerfile | 2 +- 13.0/fpm-alpine/Dockerfile | 2 +- Dockerfile-alpine.template | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/11.0/fpm-alpine/Dockerfile b/11.0/fpm-alpine/Dockerfile index 3a84692e4..7600c9018 100644 --- a/11.0/fpm-alpine/Dockerfile +++ b/11.0/fpm-alpine/Dockerfile @@ -9,7 +9,7 @@ RUN set -ex; \ rsync \ ; \ \ - mkdir -p /var/spool/cron/crontabs; \ + rm /var/spool/cron/crontabs/root; \ echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data # install the PHP extensions we need diff --git a/12.0/fpm-alpine/Dockerfile b/12.0/fpm-alpine/Dockerfile index b58dbb576..98952a8e6 100644 --- a/12.0/fpm-alpine/Dockerfile +++ b/12.0/fpm-alpine/Dockerfile @@ -9,7 +9,7 @@ RUN set -ex; \ rsync \ ; \ \ - mkdir -p /var/spool/cron/crontabs; \ + rm /var/spool/cron/crontabs/root; \ echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data # install the PHP extensions we need diff --git a/13.0/fpm-alpine/Dockerfile b/13.0/fpm-alpine/Dockerfile index 0c430045e..1024772c6 100644 --- a/13.0/fpm-alpine/Dockerfile +++ b/13.0/fpm-alpine/Dockerfile @@ -9,7 +9,7 @@ RUN set -ex; \ rsync \ ; \ \ - mkdir -p /var/spool/cron/crontabs; \ + rm /var/spool/cron/crontabs/root; \ echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data # install the PHP extensions we need diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index 8fecc85fe..0e0c6cea9 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -9,7 +9,7 @@ RUN set -ex; \ rsync \ ; \ \ - mkdir -p /var/spool/cron/crontabs; \ + rm /var/spool/cron/crontabs/root; \ echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data # install the PHP extensions we need