Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use PHP 8.0 for Nextcloud 22 image #1421

Closed
siccovansas opened this issue Feb 22, 2021 · 10 comments · Fixed by #1563
Closed

Use PHP 8.0 for Nextcloud 22 image #1421

siccovansas opened this issue Feb 22, 2021 · 10 comments · Fixed by #1563

Comments

@siccovansas
Copy link

siccovansas commented Feb 22, 2021

The current Nextcloud 21 image still uses PHP 7.4. Nextcloud 21 supports PHP 8.0 and it gives some performance improvements, so it would be awesome if the Nextcloud 21 image uses PHP 8.0.

@markuman
Copy link

markuman commented Feb 22, 2021

The main issue is, that the latest released version of imagick (3.4.4) that is shipped with pecl is not compatible with php 8

Imagick/imagick#331 (comment)

@markuman
Copy link

markuman commented Feb 22, 2021

works for me.
but I load the release from github, because nextcloud.com is on fire again.

diff --git a/21.0/apache/Dockerfile b/21.0/apache/Dockerfile
index 52fab6e..ba6f3bf 100644
--- a/21.0/apache/Dockerfile
+++ b/21.0/apache/Dockerfile
@@ -1,5 +1,5 @@
 # DO NOT EDIT: created by update.sh from Dockerfile-debian.template
-FROM php:7.4-apache-buster
+FROM php:8.0-apache-buster
 
 # entrypoint.sh and cron.sh dependencies
 RUN set -ex; \
@@ -60,10 +60,12 @@ RUN set -ex; \
     ; \
     \
 # pecl will claim success even if one install fails, so we need to perform each install separately
-    pecl install APCu-5.1.19; \
-    pecl install memcached-3.1.5; \
-    pecl install redis-5.3.3; \
-    pecl install imagick-3.4.4; \
+    pecl install APCu; \
+    pecl install memcached; \
+    pecl install redis; \
+    mkdir -p /usr/src/php/ext/imagick; \
+    curl -fsSL https://github.com/Imagick/imagick/archive/06116aa24b76edaf6b1693198f79e6c295eda8a9.tar.gz | tar xvz -C "/usr/src/php/ext/imagick" --strip 1; \
+    docker-php-ext-install imagick; \
     \
     docker-php-ext-enable \
         apcu \
@@ -130,17 +132,12 @@ RUN set -ex; \
     apt-get update; \
     apt-get install -y --no-install-recommends $fetchDeps; \
     \
-    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 --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
-    gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
-    tar -xjf nextcloud.tar.bz2 -C /usr/src/; \
+    curl -fsSL -o nextcloud.tar.gz \
+        "https://github.com/nextcloud/server/archive/v${NEXTCLOUD_VERSION}.tar.gz"; \
+    tar -xf nextcloud.tar.gz -C /usr/src/; \
+    mv /usr/src/server-21.0.0 /usr/src/nextcloud; \
     gpgconf --kill all; \
-    rm nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
+    rm nextcloud.tar.*; \
     rm -rf "$GNUPGHOME" /usr/src/nextcloud/updater; \
     mkdir -p /usr/src/nextcloud/data; \
     mkdir -p /usr/src/nextcloud/custom_apps; \

@J0WI
Copy link
Contributor

J0WI commented Feb 25, 2021

PHP 7.4 is still the recommend version and 8.0 is not mentioned at all: https://docs.nextcloud.com/server/21/admin_manual/installation/system_requirements.html
Let's give app and extension developers some time to migrate and test.

@WhiteBahamut
Copy link

It is actually stated in the announcements itself "...The move to PHP 8 will also give a nice performance boost for systems that have it installed!..." -> https://nextcloud.com/blog/nextcloud-faster-than-ever-introducing-files-high-performance-back-end/. You could see this as an recommendation to use php 8 ;-)

But I do understand the desire to have only released php plugins installed and pinned to a version. But I think in the past there were similar problems with imagick, it holds back a general upgrade.

Maybe there can be a dedicated dockerfile (-> image) with php8? even though it can get a configuration hell..

@mlocati
Copy link

mlocati commented Mar 18, 2021

The main issue is, that the latest released version of imagick (3.4.4) that is shipped with pecl is not compatible with php 8

You can easily install imagick on php 8.0 with https://github.com/mlocati/docker-php-extension-installer

@TBK
Copy link

TBK commented Jun 26, 2021

With the release of imagick 3.5.0 (2021-06-17) it now supports PHP 8. So there should be no technical limitation to providing PHP 8 based NextCloud images.

@J0WI
Copy link
Contributor

J0WI commented Jun 29, 2021

PHP 7.4 is still the recommend version and 8.0 is not mentioned at all: https://docs.nextcloud.com/server/21/admin_manual/installation/system_requirements.html
Let's give app and extension developers some time to migrate and test.

Maybe this will change for Nextcloud 22. There are still some open bugs at https://github.com/nextcloud/server

@J0WI
Copy link
Contributor

J0WI commented Aug 2, 2021

Most upstream bugs are tracked at nextcloud/server#25806

@J0WI J0WI added the upstream label Aug 2, 2021
@mathuaerknedam
Copy link

PHP 8 is now the officially recommended version on the system requirements page. I hope this means the docker images will soon be updated to use it (21.0.4 and 22.1.0 don't).

@J0WI J0WI changed the title Use PHP 8.0 for Nextcloud 21 image Use PHP 8.0 for Nextcloud 22 image Aug 23, 2021
@J0WI J0WI mentioned this issue Aug 23, 2021
@loxK
Copy link

loxK commented Aug 26, 2021

I upgraded my Nextcloud 21 to PHP8.0, and I can feel the better performances. A worthy upgrade.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants