docker icon indicating copy to clipboard operation
docker copied to clipboard

SVG imagemagick Nextcloud 21.0 Docker

Open sparklyballs opened this issue 3 years ago • 82 comments

With the recent update to the vanilla library Nextcloud docker image on x86_64, i.e docker pull nextcloud, bumping the version of nextcloud to 21.0, some warnings appear,of which all but one were trivial to solve.

Whilst I know that the issue of svg compatibility and imagemagick has been raised several times, and at risk of this being marked as duplicate etc and closed , I feel now is the time to actually address it by either adding whatever is required to the image or removing this new warning.

Screenshot from 2021-02-20 11-02-20

And I understand that current advice is to modify a local Dockerfile to add the required packages etc, this isn't always an easy solution, and that (at least for now) there is a specific warning appearing about this, to suggest that people effectively create their own image locally seems a little silly.

sparklyballs avatar Feb 20 '21 11:02 sparklyballs

Agreed. Also, there's a warning regarding the default phone region code.

cformal avatar Feb 21 '21 03:02 cformal

Agreed. Also, there's a warning regarding the default phone region code.

https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html#user-experience

sparklyballs avatar Feb 21 '21 09:02 sparklyballs

Agreed. Also, there's a warning regarding the default phone region code.

https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html#user-experience

Yes, of course. But I thought it's a good idea to provide an ENV VAR for docker users. I really don't want to modify php files while using docker.

cformal avatar Feb 21 '21 15:02 cformal

Agreed. Also, there's a warning regarding the default phone region code.

https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html#user-experience

Yes, of course. But I thought it's a good idea to provide an ENV VAR for docker users. I really don't want to modify php files while using docker.

Your config file is in your volume/mount.

Sveeeeeen avatar Feb 21 '21 16:02 Sveeeeeen

Agreed. Also, there's a warning regarding the default phone region code.

https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html#user-experience

Yes, of course. But I thought it's a good idea to provide an ENV VAR for docker users. I really don't want to modify php files while using docker.

Your config file is in your volume/mount.

Surely I know that. But what I expect to see is that I provide a set of Dockerfile, docker-compose.yml, and .env, I copy them to the server, run docker-compose up --build -d, and that's it.

cformal avatar Feb 21 '21 16:02 cformal

I feel setting a default phone region in the image isn't a one size fits all solution and might even confuse users. An env variable or even a graphical setting in the nextcloud UI might be a good solution for that. It's also not related to the topic of this issue, so perhaps a different issue can be made for that.

NanoSector avatar Feb 22 '21 08:02 NanoSector

I also have solved all warnings but the one related to php-imagick with the container for version 21.
Shouldn't the container provide the ideal configuration for Nextcloud on it's own? So either add the php module to the container or remove the warning. But having a warning in a supposedly ideal environment seems counter intuitive to me.

ThxAndBye avatar Feb 22 '21 12:02 ThxAndBye

Eu também resolvi todos os avisos, exceto aquele relacionado ao php-imagick com o contêiner para a versão 21.

Were you able to resolve this warning?

Your web server is not configured correctly to resolve "/.well-known/webfinger". More information can be found in the documentation.
Your web server is not configured correctly to resolve "/.well-known/nodeinfo". More information can be found in the documentation.

I am using ngnix and not apache.

talesam avatar Feb 22 '21 13:02 talesam

I am using ngnix and not apache.

Yes, I'm also using nginx (with the nextcloud-fpm container) and you need to recreate your configuration according to new new configuration as the redirects changed.
https://docs.nextcloud.com/server/latest/admin_manual/installation/nginx.html

ThxAndBye avatar Feb 22 '21 14:02 ThxAndBye

I am using ngnix and not apache.

Yes, I'm also using nginx (with the nextcloud-fpm container) and you need to recreate your configuration according to new new configuration as the redirects changed. https://docs.nextcloud.com/server/latest/admin_manual/installation/nginx.html

I didn't find this file to edit, did it exist or did you have to create it? I'm using this setting

https://cloud.talesam.org/s/SxC77dRi7WgkGBA

talesam avatar Feb 22 '21 14:02 talesam

I am using ngnix and not apache.

Yes, I'm also using nginx (with the nextcloud-fpm container) and you need to recreate your configuration according to new new configuration as the redirects changed. https://docs.nextcloud.com/server/latest/admin_manual/installation/nginx.html

I didn't find this file to edit, did it exist or did you have to create it? I'm using this setting

https://cloud.talesam.org/s/SxC77dRi7WgkGBA

In .\web\nginx.conf is your configuration. But it seems to have some modifications applied to it, so you have to create a new one by combining what you need from your current config and what's new in the nextcloud docs.
But you also seem to use some kind of preconfigured proxy config, I have no experience with those as I've configured my nginx from the official container.

ThxAndBye avatar Feb 22 '21 14:02 ThxAndBye

In .\web\nginx.conf is your configuration. But it seems to have some modifications applied to it, so you have to create a new one by combining what you need from your current config and what's new in the nextcloud docs. But you also seem to use some kind of preconfigured proxy config, I have no experience with those as I've configured my nginx from the official container.

ok, thanks, i'll take a look.

talesam avatar Feb 22 '21 14:02 talesam

Hi, same problem here, should we just leave showing up this svg warning? I think exactly the same as @ThxAndBye Thanks

ecov773 avatar Feb 23 '21 07:02 ecov773

Same here

maxulm avatar Feb 23 '21 13:02 maxulm

Same for me, it really bugs my mind to see that warning that I can't easily fix.

LouisVallat avatar Feb 23 '21 14:02 LouisVallat

This should be corrected in the image of the docker, it does not make sense to install something that is made to work in a way and create workarounds to correct a problem that was not solved in the cause.

talesam avatar Feb 23 '21 15:02 talesam

libmagickcore-6.q16-6-extra is missing and solves the issue.

Here is the part of the admin manual that mentioned the dependency: https://docs.nextcloud.com/server/21/admin_manual/configuration_server/theming.html?highlight=libmagickcore%20q16%20extra#theming-of-icons

SVG support for imagick (e.g. libmagickcore-6.q16-3-extra on Debian 9 and Ubuntu 18.04)

But the official docker image based on Debian 10, so it's libmagickcore-6.q16-6-extra

markuman avatar Feb 24 '21 10:02 markuman

And for those who use docker with the nextcloud:fpm-alpine image? It would be something like ...

Create Dockerfile

FROM nextcloud:fpm-alpine
RUN apk update && apk add package

The problem is which package to install.

/ # apk list | grep magick
ruby-rmagick-4.1.2-r1 x86_64 {ruby-rmagick} (MIT)
graphicsmagick-zsh-completion-5.8-r1 x86_64 {zsh} (custom)
php8-pecl-imagick-dev-3.4.4-r0 x86_64 {php8-pecl-imagick} (PHP-3.01)
imagemagick-perlmagick-doc-7.0.10.57-r0 x86_64 {imagemagick} (ImageMagick)
php7-pecl-imagick-dev-3.4.4-r7 x86_64 {php7-pecl-imagick} (PHP-3.01)
graphicsmagick-1.3.36-r0 x86_64 {graphicsmagick} (MIT)
php7-pecl-imagick-3.4.4-r7 x86_64 {php7-pecl-imagick} (PHP-3.01)
imagemagick-c++-7.0.10.57-r0 x86_64 {imagemagick} (ImageMagick)
php8-pecl-imagick-3.4.4-r0 x86_64 {php8-pecl-imagick} (PHP-3.01)
imagemagick6-6.9.11.55-r0 x86_64 {imagemagick6} (Apache-2.0)
graphicsmagick-dev-1.3.36-r0 x86_64 {graphicsmagick} (MIT)
imagemagick-doc-7.0.10.57-r0 x86_64 {imagemagick} (ImageMagick)
imagemagick6-dev-6.9.11.55-r0 x86_64 {imagemagick6} (Apache-2.0)
imagemagick-dev-7.0.10.57-r0 x86_64 {imagemagick} (ImageMagick)
imagemagick-static-7.0.10.57-r0 x86_64 {imagemagick} (ImageMagick)
imagemagick-zsh-completion-5.8-r1 x86_64 {zsh} (custom)
imagemagick6-libs-6.9.11.55-r0 x86_64 {imagemagick6} (Apache-2.0)
imagemagick6-c++-6.9.11.55-r0 x86_64 {imagemagick6} (Apache-2.0)
imagemagick6-doc-6.9.11.55-r0 x86_64 {imagemagick6} (Apache-2.0)
php7-pecl-gmagick-2.0.5_rc1-r6 x86_64 {php7-pecl-gmagick} (PHP-3.01)
imagemagick-perlmagick-7.0.10.57-r0 x86_64 {imagemagick} (ImageMagick)
graphicsmagick-doc-1.3.36-r0 x86_64 {graphicsmagick} (MIT)
imagemagick-libs-7.0.10.57-r0 x86_64 {imagemagick} (ImageMagick)
imagemagick-7.0.10.57-r0 x86_64 {imagemagick} (ImageMagick)

talesam avatar Feb 24 '21 15:02 talesam

And for those who use docker with the nextcloud:fpm-alpine image? It would be something like ...

Create Dockerfile

FROM nextcloud:fpm-alpine RUN apk update && apk add package

The problem is which package to install.

Try it and see :)
Jump into the container and install packages and see what packages solves it.

I guess imagemagick6-libs or imagemagick-libs

markuman avatar Feb 24 '21 16:02 markuman

And for those who use docker with the nextcloud:fpm-alpine image? It would be something like ...

Create Dockerfile

FROM nextcloud:fpm-alpine
RUN apk update && apk add package

The problem is which package to install.

/ # apk list | grep magick
ruby-rmagick-4.1.2-r1 x86_64 {ruby-rmagick} (MIT)
graphicsmagick-zsh-completion-5.8-r1 x86_64 {zsh} (custom)
php8-pecl-imagick-dev-3.4.4-r0 x86_64 {php8-pecl-imagick} (PHP-3.01)
imagemagick-perlmagick-doc-7.0.10.57-r0 x86_64 {imagemagick} (ImageMagick)
php7-pecl-imagick-dev-3.4.4-r7 x86_64 {php7-pecl-imagick} (PHP-3.01)
graphicsmagick-1.3.36-r0 x86_64 {graphicsmagick} (MIT)
php7-pecl-imagick-3.4.4-r7 x86_64 {php7-pecl-imagick} (PHP-3.01)
imagemagick-c++-7.0.10.57-r0 x86_64 {imagemagick} (ImageMagick)
php8-pecl-imagick-3.4.4-r0 x86_64 {php8-pecl-imagick} (PHP-3.01)
imagemagick6-6.9.11.55-r0 x86_64 {imagemagick6} (Apache-2.0)
graphicsmagick-dev-1.3.36-r0 x86_64 {graphicsmagick} (MIT)
imagemagick-doc-7.0.10.57-r0 x86_64 {imagemagick} (ImageMagick)
imagemagick6-dev-6.9.11.55-r0 x86_64 {imagemagick6} (Apache-2.0)
imagemagick-dev-7.0.10.57-r0 x86_64 {imagemagick} (ImageMagick)
imagemagick-static-7.0.10.57-r0 x86_64 {imagemagick} (ImageMagick)
imagemagick-zsh-completion-5.8-r1 x86_64 {zsh} (custom)
imagemagick6-libs-6.9.11.55-r0 x86_64 {imagemagick6} (Apache-2.0)
imagemagick6-c++-6.9.11.55-r0 x86_64 {imagemagick6} (Apache-2.0)
imagemagick6-doc-6.9.11.55-r0 x86_64 {imagemagick6} (Apache-2.0)
php7-pecl-gmagick-2.0.5_rc1-r6 x86_64 {php7-pecl-gmagick} (PHP-3.01)
imagemagick-perlmagick-7.0.10.57-r0 x86_64 {imagemagick} (ImageMagick)
graphicsmagick-doc-1.3.36-r0 x86_64 {graphicsmagick} (MIT)
imagemagick-libs-7.0.10.57-r0 x86_64 {imagemagick} (ImageMagick)
imagemagick-7.0.10.57-r0 x86_64 {imagemagick} (ImageMagick)

I get that you can install the packages required, I mention it in the original post. What I perceive is the real issue is that now there is a specific warning regarding this, we shouldn't have to resort to effectively hosting our own images for something that should be in the image , or the warning be removed.

sparklyballs avatar Feb 24 '21 17:02 sparklyballs

Just make a pull request ;)

markuman avatar Feb 24 '21 18:02 markuman

Ha, never thought that I would have to go into a container and install a package manually to solve a dependency for a software that is supposed to have it all included in the container image.

But running apt install libmagickcore-6.q16-6-extra (latest nextcloud container based on Debian 10) inside the container fixed the warning message about "Module php-imagick in this instance has no SVG support.".

ostefek99 avatar Feb 24 '21 21:02 ostefek99

@ostefek99, that sadly does not work for my Debian 10 container. Did you execute any other commands as well?

root@xxx:/var/www/html# apt install libmagickcore-6.q16-6-extra
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package libmagickcore-6.q16-6-extra is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'libmagickcore-6.q16-6-extra' has no installation candidate

mat-l avatar Feb 25 '21 07:02 mat-l

@mat-l did you apt update beforehand?

https://packages.debian.org/buster/libmagickcore-6.q16-6-extra this is the package you want.

Snuupy avatar Feb 25 '21 07:02 Snuupy

Consider that installing dependencies in a running container is not a persistent fix.
You must build your own image or it must go to the upstream image.

markuman avatar Feb 25 '21 08:02 markuman

@mat-l, as Snuupy sugested, you need to run apt update and then install the package (apt install).

However as markuman said, it's a workaround for a current container. It won't persist. I am not willing to build my own container. I would expect to be fixed in the image. I am however only consumer and not sure how to help to fix it. I am grateful for the such a great work that community is doing. :)

ostefek99 avatar Feb 25 '21 09:02 ostefek99

@Snuupy @ostefek99 woops, forget the update, thought I had executed it before 🙈

@markuman in my optinion it must be integrated into the upstream image. Dunno why Nextcloud didn't do this yet.

mat-l avatar Feb 25 '21 09:02 mat-l

diff --git a/21.0/apache/Dockerfile b/21.0/apache/Dockerfile
index 52fab6e..fc548ac 100644
--- a/21.0/apache/Dockerfile
+++ b/21.0/apache/Dockerfile
@@ -9,6 +9,7 @@ RUN set -ex; \
         rsync \
         bzip2 \
         busybox-static \
+        libmagickcore-6.q16-6-extra \
     ; \
     rm -rf /var/lib/apt/lists/*; \
     \

that's the fix for the apache container

markuman avatar Feb 25 '21 10:02 markuman

diff --git a/21.0/apache/Dockerfile b/21.0/apache/Dockerfile
index 52fab6e..fc548ac 100644
--- a/21.0/apache/Dockerfile
+++ b/21.0/apache/Dockerfile
@@ -9,6 +9,7 @@ RUN set -ex; \
         rsync \
         bzip2 \
         busybox-static \
+        libmagickcore-6.q16-6-extra \
     ; \
     rm -rf /var/lib/apt/lists/*; \
     \

that's the fix for the apache container

Testing this fix on my machine, I'll edit this comment with the results.

EDIT: yes it fixes it (bogs my mind a bit that it's in the "entrypoint.sh and cron.sh dependencies" part

LouisVallat avatar Feb 25 '21 10:02 LouisVallat

Also @markuman I would suggest you not to edit in the Dockerfiles themselves, they are generated from the update.sh script, so your modification will be overwritten, if I understand correctly. So I would suggest you to add the fix in the .template files, and then generate the Dockerfiles with the update script.

LouisVallat avatar Feb 25 '21 10:02 LouisVallat