N
N
nepster-web2017-01-19 20:10:54
PHP
nepster-web, 2017-01-19 20:10:54

How to install imagick for PHP7.1 (docker, alpine)?

I am learning docker, I have a task to install the Imagick extension for php:7.1-fpm-alpine
Example:

# Imagick
ENV IMAGICK_VERSION 3.4.1
RUN apk add --no-cache imagemagick-dev libtool autoconf gcc g++ make \
    && pecl install imagick-$IMAGICK_VERSION \
    && echo "extension=imagick.so" > /usr/local/etc/php/conf.d/ext-imagick.ini \
    && apk del libtool autoconf gcc g++ make

The problem is that during the installation the question is asked:
19 source files, building
running: phpize
Configuring for:
PHP Api Version:         20160303
Zend Module Api No:      20160303
Zend Extension Api No:   320160303
Please provide the prefix of Imagemagick installation [autodetect] :

Docker ignores this moment and the utility is installed, but the module for php is not. In manual mode, I checked, if you press enter, everything comes in as native.
Please tell me how to be in this case?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Tyranron, 2017-01-19
@nepster-web

In such cases, through the sub-shell, you can feed the team what it asks for.
For example:

# Install Xdebug
RUN apk add --update --no-cache --virtual .tools-deps \
            autoconf g++ libtool make \
 && (yes | pecl install xdebug) \
 && apk del .tools-deps \
 && rm -rf /var/cache/apk/*

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question