Skip to content

Commit cdd12cc

Browse files
authored
Merge pull request #42 from tilosp-docker/php5.6
Changed the php version back to 5.6 for Nextcloud 9 and 10
2 parents 362905d + 4139674 commit cdd12cc

File tree

7 files changed

+96
-26
lines changed

7 files changed

+96
-26
lines changed

10.0/apache/Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM php:7.1-apache
1+
FROM php:5.6-apache
22

33
RUN apt-get update && apt-get install -y \
44
bzip2 \
@@ -17,7 +17,7 @@ RUN apt-get update && apt-get install -y \
1717
# https://docs.nextcloud.com/server/9/admin_manual/installation/source_installation.html
1818
RUN docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
1919
&& docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu \
20-
&& docker-php-ext-install gd exif intl mbstring mcrypt ldap mysqli opcache pdo_mysql pdo_pgsql pgsql zip
20+
&& docker-php-ext-install gd exif intl mbstring mcrypt ldap mysql opcache pdo_mysql pdo_pgsql pgsql zip
2121

2222
# set recommended PHP.ini settings
2323
# see https://secure.php.net/manual/en/opcache.installation.php
@@ -33,9 +33,9 @@ RUN a2enmod rewrite
3333

3434
# PECL extensions
3535
RUN set -ex \
36-
&& pecl install APCu-5.1.8 \
37-
&& pecl install memcached-3.0.2 \
38-
&& pecl install redis-3.1.1 \
36+
&& pecl install APCu-4.0.10 \
37+
&& pecl install memcached-2.2.0 \
38+
&& pecl install redis-2.2.8 \
3939
&& docker-php-ext-enable apcu redis memcached
4040
RUN a2enmod rewrite
4141

10.0/fpm/Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM php:7.1-fpm
1+
FROM php:5.6-fpm
22

33
RUN apt-get update && apt-get install -y \
44
bzip2 \
@@ -17,7 +17,7 @@ RUN apt-get update && apt-get install -y \
1717
# https://docs.nextcloud.com/server/9/admin_manual/installation/source_installation.html
1818
RUN docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
1919
&& docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu \
20-
&& docker-php-ext-install gd exif intl mbstring mcrypt ldap mysqli opcache pdo_mysql pdo_pgsql pgsql zip
20+
&& docker-php-ext-install gd exif intl mbstring mcrypt ldap mysql opcache pdo_mysql pdo_pgsql pgsql zip
2121

2222
# set recommended PHP.ini settings
2323
# see https://secure.php.net/manual/en/opcache.installation.php
@@ -32,9 +32,9 @@ RUN { \
3232

3333
# PECL extensions
3434
RUN set -ex \
35-
&& pecl install APCu-5.1.8 \
36-
&& pecl install memcached-3.0.2 \
37-
&& pecl install redis-3.1.1 \
35+
&& pecl install APCu-4.0.10 \
36+
&& pecl install memcached-2.2.0 \
37+
&& pecl install redis-2.2.8 \
3838
&& docker-php-ext-enable apcu redis memcached
3939

4040
ENV NEXTCLOUD_VERSION 10.0.4

9.0/apache/Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM php:7.1-apache
1+
FROM php:5.6-apache
22

33
RUN apt-get update && apt-get install -y \
44
bzip2 \
@@ -17,7 +17,7 @@ RUN apt-get update && apt-get install -y \
1717
# https://docs.nextcloud.com/server/9/admin_manual/installation/source_installation.html
1818
RUN docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
1919
&& docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu \
20-
&& docker-php-ext-install gd exif intl mbstring mcrypt ldap mysqli opcache pdo_mysql pdo_pgsql pgsql zip
20+
&& docker-php-ext-install gd exif intl mbstring mcrypt ldap mysql opcache pdo_mysql pdo_pgsql pgsql zip
2121

2222
# set recommended PHP.ini settings
2323
# see https://secure.php.net/manual/en/opcache.installation.php
@@ -33,9 +33,9 @@ RUN a2enmod rewrite
3333

3434
# PECL extensions
3535
RUN set -ex \
36-
&& pecl install APCu-5.1.8 \
37-
&& pecl install memcached-3.0.2 \
38-
&& pecl install redis-3.1.1 \
36+
&& pecl install APCu-4.0.10 \
37+
&& pecl install memcached-2.2.0 \
38+
&& pecl install redis-2.2.8 \
3939
&& docker-php-ext-enable apcu redis memcached
4040
RUN a2enmod rewrite
4141

9.0/fpm/Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM php:7.1-fpm
1+
FROM php:5.6-fpm
22

33
RUN apt-get update && apt-get install -y \
44
bzip2 \
@@ -17,7 +17,7 @@ RUN apt-get update && apt-get install -y \
1717
# https://docs.nextcloud.com/server/9/admin_manual/installation/source_installation.html
1818
RUN docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
1919
&& docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu \
20-
&& docker-php-ext-install gd exif intl mbstring mcrypt ldap mysqli opcache pdo_mysql pdo_pgsql pgsql zip
20+
&& docker-php-ext-install gd exif intl mbstring mcrypt ldap mysql opcache pdo_mysql pdo_pgsql pgsql zip
2121

2222
# set recommended PHP.ini settings
2323
# see https://secure.php.net/manual/en/opcache.installation.php
@@ -32,9 +32,9 @@ RUN { \
3232

3333
# PECL extensions
3434
RUN set -ex \
35-
&& pecl install APCu-5.1.8 \
36-
&& pecl install memcached-3.0.2 \
37-
&& pecl install redis-3.1.1 \
35+
&& pecl install APCu-4.0.10 \
36+
&& pecl install memcached-2.2.0 \
37+
&& pecl install redis-2.2.8 \
3838
&& docker-php-ext-enable apcu redis memcached
3939

4040
ENV NEXTCLOUD_VERSION 9.0.57

Dockerfile-php7.template

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
FROM php:7.1-%%VARIANT%%
2+
3+
RUN apt-get update && apt-get install -y \
4+
bzip2 \
5+
libcurl4-openssl-dev \
6+
libfreetype6-dev \
7+
libicu-dev \
8+
libjpeg-dev \
9+
libldap2-dev \
10+
libmcrypt-dev \
11+
libmemcached-dev \
12+
libpng12-dev \
13+
libpq-dev \
14+
libxml2-dev \
15+
&& rm -rf /var/lib/apt/lists/*
16+
17+
# https://docs.nextcloud.com/server/9/admin_manual/installation/source_installation.html
18+
RUN docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
19+
&& docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu \
20+
&& docker-php-ext-install gd exif intl mbstring mcrypt ldap mysqli opcache pdo_mysql pdo_pgsql pgsql zip
21+
22+
# set recommended PHP.ini settings
23+
# see https://secure.php.net/manual/en/opcache.installation.php
24+
RUN { \
25+
echo 'opcache.memory_consumption=128'; \
26+
echo 'opcache.interned_strings_buffer=8'; \
27+
echo 'opcache.max_accelerated_files=4000'; \
28+
echo 'opcache.revalidate_freq=60'; \
29+
echo 'opcache.fast_shutdown=1'; \
30+
echo 'opcache.enable_cli=1'; \
31+
} > /usr/local/etc/php/conf.d/opcache-recommended.ini
32+
RUN a2enmod rewrite
33+
34+
# PECL extensions
35+
RUN set -ex \
36+
&& pecl install APCu-5.1.8 \
37+
&& pecl install memcached-3.0.2 \
38+
&& pecl install redis-3.1.1 \
39+
&& docker-php-ext-enable apcu redis memcached
40+
RUN a2enmod rewrite
41+
42+
ENV NEXTCLOUD_VERSION %%VERSION%%
43+
VOLUME /var/www/html
44+
45+
RUN curl -fsSL -o nextcloud.tar.bz2 \
46+
"https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2" \
47+
&& curl -fsSL -o nextcloud.tar.bz2.asc \
48+
"https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc" \
49+
&& export GNUPGHOME="$(mktemp -d)" \
50+
# gpg key from https://nextcloud.com/nextcloud.asc
51+
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A \
52+
&& gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2 \
53+
&& rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc \
54+
&& tar -xjf nextcloud.tar.bz2 -C /usr/src/ \
55+
&& rm nextcloud.tar.bz2
56+
57+
COPY docker-entrypoint.sh /entrypoint.sh
58+
59+
ENTRYPOINT ["/entrypoint.sh"]
60+
CMD ["%%CMD%%"]

Dockerfile.template

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM php:7.1-%%VARIANT%%
1+
FROM php:5.6-%%VARIANT%%
22

33
RUN apt-get update && apt-get install -y \
44
bzip2 \
@@ -17,7 +17,7 @@ RUN apt-get update && apt-get install -y \
1717
# https://docs.nextcloud.com/server/9/admin_manual/installation/source_installation.html
1818
RUN docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
1919
&& docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu \
20-
&& docker-php-ext-install gd exif intl mbstring mcrypt ldap mysqli opcache pdo_mysql pdo_pgsql pgsql zip
20+
&& docker-php-ext-install gd exif intl mbstring mcrypt ldap mysql opcache pdo_mysql pdo_pgsql pgsql zip
2121

2222
# set recommended PHP.ini settings
2323
# see https://secure.php.net/manual/en/opcache.installation.php
@@ -33,9 +33,9 @@ RUN a2enmod rewrite
3333

3434
# PECL extensions
3535
RUN set -ex \
36-
&& pecl install APCu-5.1.8 \
37-
&& pecl install memcached-3.0.2 \
38-
&& pecl install redis-3.1.1 \
36+
&& pecl install APCu-4.0.10 \
37+
&& pecl install memcached-2.2.0 \
38+
&& pecl install redis-2.2.8 \
3939
&& docker-php-ext-enable apcu redis memcached
4040
RUN a2enmod rewrite
4141

update.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ declare -A cmd=(
66
[fpm]='php-fpm'
77
)
88

9+
# version_greater_or_equal A B returns whether A >= B
10+
function version_greater_or_equal() {
11+
[[ "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1" || "$1" == "$2" ]];
12+
}
13+
914
latests=( $(curl -sSL 'https://nextcloud.com/changelog/' |tac|tac| \
1015
grep -o "\(Version\|Release\)\s\+[[:digit:]]\+\(\.[[:digit:]]\+\)\+" | \
1116
awk '{ print $2 }' | sort -V ) )
@@ -16,7 +21,12 @@ for latest in "${latests[@]}"; do
1621
for variant in apache fpm; do
1722
# Create the version+variant directory with a Dockerfile.
1823
mkdir -p "$version/$variant"
19-
cp Dockerfile.template "$version/$variant/Dockerfile"
24+
25+
template="Dockerfile.template"
26+
if version_greater_or_equal "$version" "11.0"; then
27+
template="Dockerfile-php7.template"
28+
fi
29+
cp "$template" "$version/$variant/Dockerfile"
2030

2131
echo "updating $latest [$version] $variant"
2232

0 commit comments

Comments
 (0)