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

Add ImageMagick PHP extension to support "Theming of icons" #263

Closed
suntorytimed opened this issue Feb 14, 2018 · 16 comments
Closed

Add ImageMagick PHP extension to support "Theming of icons" #263

suntorytimed opened this issue Feb 14, 2018 · 16 comments

Comments

@suntorytimed
Copy link

The current docker image doesn't provide the dependencies for "Theming of icons":

https://docs.nextcloud.com/server/13/admin_manual/configuration_server/theming.html#theming-of-icons

Please add the ImageMagick PHP extension and ImageMagick SVG support to the container to support custom favicons in settings/admin/theming of Nextcloud.

@phlegx
Copy link

phlegx commented Apr 11, 2018

Here our Dockerfile code to add Imagemagick.

FROM nextcloud:13.0.1-fpm

RUN apt-get update; \
    apt-get install -y --no-install-recommends \
        sudo \
        libmagickwand-dev \
        libmagickcore-extra \
    ; \
    pecl install imagick; \
    docker-php-ext-enable imagick; \
    apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
    rm -rf /var/lib/apt/lists/*

@suntorytimed
Copy link
Author

Don't forget to cleanup the dpkg cache after the installation of the packages.

@phlegx
Copy link

phlegx commented Apr 12, 2018

@suntorytimed please add the cleanup Dockerfile code. Did you mean this, like in the Nextcloud Dockerfile?

RUN apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
    rm -rf /var/lib/apt/lists/*

@suntorytimed
Copy link
Author

suntorytimed commented Apr 12, 2018

@phlegx yes, something like this. It should be part of the RUN command that executes apt-get. You could also add

apt-get clean

Docker provides some best practices (https://docs.docker.com/develop/develop-images/dockerfile_best-practices/) They state that it is not necessary to run apt-get clean, because the official image does this already, but I do it anyways just to be safe.

I also tend to split my commands in several RUNs so more snapshots are created and can be reused. I would also avoid installing sudo if you don't need it for specific tasks:

FROM nextcloud:13.0.1-fpm

RUN apt-get update && \
    apt-get install -y --no-install-recommends \
        libmagickwand-dev \
        libmagickcore-extra \
        && apt-get clean \
        && rm -rf /var/lib/apt/lists/*
RUN pecl install imagick
RUN docker-php-ext-enable imagick

EDIT: And instead of ; use && to separate your commands. This way the next command will only be executed if the previous one was successful.

@seblu
Copy link

seblu commented Jun 15, 2018

What could make this be added to official images? Do you expect a merge request?

@lupa18
Copy link

lupa18 commented Jul 24, 2018

Hello, I'm getting this error:

E: Package 'libmagickcore-extra' has no installation candidate

@rubo77
Copy link
Contributor

rubo77 commented Aug 20, 2018

maybe try libmagickcore-6.q16-3-extra or libmagickcore-6.q16hdri-3-extra instead?

Or maybe it is not needed at all. in the full dockerfile example it is not listed either.

@lupa18
Copy link

lupa18 commented Aug 20, 2018

@rubo77 work with libmagickcore-6.q16-3-extra

thanks!

@rubo77
Copy link
Contributor

rubo77 commented Aug 20, 2018

What is the extra package for?

Should we add it to the "full" docker file?

@lupa18
Copy link

lupa18 commented Aug 20, 2018

As I can understand, this package is a dependence for compiling imagick's php extension: docker-php-ext-enable imagick

rcdailey added a commit to rcdailey/docker that referenced this issue Dec 12, 2018
There is a warning issued in Nextcloud 15 about 'imagick' php extension not
being present. They highly recommend that it be installed.

Fixes nextcloud#574, fixes nextcloud#263

Signed-off-by: Robert Dailey <rcdailey@gmail.com>
@J0WI J0WI closed this as completed in #575 Dec 12, 2018
@seblu
Copy link

seblu commented Jan 14, 2019

It seems that it does not work. Tested with nextcloud 15.0.2.

@fuse314
Copy link

fuse314 commented Jan 14, 2019

The "extra" package (for svg support) is still missing in the official images.
#575 only added imagick (supports "most used" image file types like png,jpg,bmp for previews).
See #594 .

@seblu
Copy link

seblu commented Jan 14, 2019

Thanks! I didn't notice the second MR.

I think this should not be closed until theming of icons is complete.

@abdulocracy
Copy link

This issue still isn't resolved (16.0.4) so shouldn't be closed. The SVG support is missing, as @fuse314 mentioned.

@J0WI
Copy link
Contributor

J0WI commented Sep 11, 2019

Please see #759 and #594 (comment).

@pgassmann
Copy link

In nextcloud 17, imagemagick svg support is used to convert various elements like folder icons. the package is missing in the official nextcloud:17-fpm image. The folders and my logo were black after the upgrade to 17.

my workaround:

docker-compose exec nextcloud bash
apt install libmagickcore-6.q16-6-extra
./occ repair # clean frontend caches
docker-compose restart

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

No branches or pull requests

10 participants