skip to Main Content

I have updated

FROM php:7.1.27-fpm

to

FROM php:7.1.33-fpm

Next command is in my docker file

RUN apt-get update imagemagick 

it updates ImageMagick version from

Version: ImageMagick 6.9.7-4

to

Version: ImageMagick 6.9.10-23

I don’t want to update the ImageMagick version to 6.9.10-23 & also don’t want to install specific version via wget.

Any other solution? Is there any way from which I can install specific version of ImageMagick instead of using wget?

2

Answers


  1. apt-get update imagemagick 
    

    yields E: The update command takes no argument.

    If you don’t want to upgrade IM why are you running the command in the first place (or was that apt-get install)?

    Anyway this isn’t really an ImageMagick question, just a Docker packaging one. The PHP image is based on Debian, its authors assume that this version of PHP works well with the provided version of Apache and the provided version of ImageMagick (and the all-important underlying version of Glibc…).

    Possible solutions

    • Amend the Dockerfile to build the image to produce an image more to your liking (but you will have to test that everything works together).
    • Build your image using your previous FROM php:7.1.27-fpm and upgrade PHP on image.
    • Get the .DEB of the required release of ImageMagick, and COPY it in the image and install from that .DEB
    Login or Signup to reply.
  2. If you want to have imagick installed here is Dockerfile

    FROM php:7.1.27-fpm
    
    RUN apt-get update
    
    RUN apt-get install -y libmagickwand-dev 
    RUN apt-get install -y imagemagick
    
    RUN pecl install imagick
    RUN docker-php-ext-enable imagick
    

    no need for wget etc.

    if you buld the image this way:

    docker build --tag stackoverflow .
    

    you can log into its shell this way:

    docker run -it --rm --entrypoint="" stackoverflow /bin/bash
    

    when you’re logged into CLI issue a command to see if its is installed (should be called imagick) under [PHP Modules]

    php -m
    

    and issuing the command:

    php -r "echo phpversion('imagick');"
    

    will give you imagick extension number (at this moment gives 3.4.4)

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search