phpearth / docker-php

🐳 Docker For PHP developers - Docker images with PHP, Nginx, OpenLiteSpeed, Apache, Lighttpd, and Alpine
https://docs.php.earth/docker
MIT License
261 stars 80 forks source link

Add a way to install pecl extensions. #27

Closed adaliszk closed 5 years ago

adaliszk commented 5 years ago

Currently, I need to manually install the phpize dependencies and the dev package to use pecl install, it would be nice if we would have an entrypoint or command to add pecl extensions more easily just like the official php image has.

What I'm doing right now:

ENV PHPIZE_DEPS="git file re2c autoconf make zlib zlib-dev g++"
RUN apk add --no-cache ${PHPIZE_DEPS} "php7.2-dev"
RUN pecl install xdebug # for example, I know that we have a package for this
RUN apk del ${PHPIZE_DEPS}

What would be nice: https://docs.docker.com/samples/library/php/#pecl-extensions

RUN pecl install xdebug && docker-php-ext-enable xdebug
petk commented 5 years ago

Hello, thanks for suggestion and reporting this issue. However, I'm not entirely sure what you have in mind exactly here. What I can say is that I'm -1 on implementing another customized-only-for-alpine solution to install PECL extensions. What is needed is something better and actually a rewrite of pecl command script instead. Until this can be done, pecl is what should be used for this.

For adding more phpize dependencies such as re2c, autoconf and such, I'll check. Basically these should already be included in most cases I think...

petk commented 5 years ago

With the php7.3-dev package these mentioned dependencies are already installed:

petk commented 5 years ago

As said above, yes. PECL is the right target here... For the pecl bugs and feature requests, for now, just report them at bugs.php.net instead. Otherwise it is part of the pear-core (not very well separated into it's own repository yet).