I have the following in a Dockerfile for a container running PHP5.x:

RUN apt-get install -y php5-imagick libmagickwand-dev libmagickcore-dev
RUN pecl install imagick
RUN echo "extension=`php -i | grep ^extension_dir | cut -f 3 -d ' '`/imagick.so" >> /usr/local/etc/php/conf.d/xdebug.ini

The build process for the container does not provide any complaint. When I view phpinfo() output after running the container, there is no mention of imagick.

Is there an obvious step I am missing?

Why is this failing silently?

(This is in the context of a swarm that includes an upstream container running nginx.)


The answer to this lay in the way my swarm was set up.

My docker-compose.yml file had been telling the swarm to use my local Dockerfile for the container that allowed local cli access, but it was running the php service through a different container. Adding a "build" property (including "context" and "dockerfile" child properties) that pointed the relevant container at that local Dockerfile fixed the problem.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.