-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Add description for docker-php-ext-install
#130
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
Conversation
👍 |
1 similar comment
👍 |
Great! Thanks |
libjpeg9 libjpeg9-dbg libjpeg9-dev \ | ||
libmcrypt-dev libmcrypt4 mcrypt \ | ||
&& docker-php-ext-install gd mcrypt | ||
CMD ["php-fpm"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be inherited from the base image, won't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following simple example works well for me (to get both gd
and mcrypt
):
FROM php:5.6-fpm
RUN apt-get update && apt-get install -y \
libpng12-dev \
libmcrypt-dev \
&& docker-php-ext-install gd mcrypt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example is using php 5.5, which is probably more common than @tianon's example with 5.6 (since it is still quite new).
We should minimally change to php:5.5-fpm
so that it does not have to be updated quite as often, rather than the 5.5.19-fpm
which is already out of date.
Also, libjpeg9
(plus dev and dbg versions) does not exist in debian:jessie
; it has been replaced by libjpeg62-turbo
. Does it really need all those dependencies to build and later run? Can we simplify it like @tianon's example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
I keep getting errors like 403 Forbidden [IP: 193.140.100.100 80]
, can't test it now.
Other than my two nits, generally LGTM 👍 |
Oh, and please use |
Updated. : ) |
|
||
For example, if you want to have a PHP-FPM image with `gd` and `mcrypt` | ||
extensions, you can inheriting the base image that you like, and write your own | ||
Dockerfile like this: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, Dockerfile
should be in backticks too. 👍
Updated. : ) |
Why doesn't the script |
"only" We'd have to collect the dependencies of every module in the PHP core, which is not a small list: ( $ docker run -it --rm php:5.6 docker-php-ext-install
usage: /usr/local/bin/docker-php-ext-install ext-name [ext-name ...]
ie: /usr/local/bin/docker-php-ext-install gd mysqli
/usr/local/bin/docker-php-ext-install pdo pdo_mysql
if custom ./configure arguments are necessary, see docker-php-ext-configure
Possible values for ext-name:
bcmath bz2 calendar ctype curl dba dom enchant exif fileinfo filter ftp gd gettext gmp hash iconv imap interbase intl json ldap mbstring mcrypt mssql mysql mysqli oci8 odbc opcache pcntl pdo pdo_dblib pdo_firebird pdo_mysql pdo_oci pdo_odbc pdo_pgsql pdo_sqlite pgsql phar posix pspell readline recode reflection session shmop simplexml snmp soap sockets spl standard sybase_ct sysvmsg sysvsem sysvshm tidy tokenizer wddx xml xmlreader xmlrpc xmlwriter xsl zip |
But every developer has to look up the deps manually or did I miss something here. How do you know which packages to install first? |
I usually just try it. When it complains about a header file (like, There's not an existing reference of every module's required packages that I'm aware of, and as you can see, it would be fairly tedious to create and would have quite the potential for getting outdated since we have such a large surface area, so I wouldn't be comfortable with such a list unless it also came with a nice way to verify that the list is still current and accurate (including whether the modules referenced still do require the packages we think they do). |
I totally agree with you that the list needs to be maintained and for sure this is some work to do. But all the things you mentioned are a reason to maintain such a list, everyone has to find out what works over and over again, especially when there are updates, IMHO. At the moment, to be honest, this keeps me a away from using this image (which I'd really like to do) - but it's much more to work to try and error with the dependencies and build over and over again, than just running |
If someone is willing to maintain such a list, then by all means, please step up. I'm not opposed to such a list if it has a dedicated maintainer who's willing to constantly update it will all possible permutations. |
Intresting, this list could be really useful. Is there any one? |
I solved my problem, never mind.. I just saw the notes you guy added 3 days ago, now I'm trying to make this |
LGTM |
Awesome, thanks! LGTM |
Add description for `docker-php-ext-install`
Thanks! |
Updated apt_cacher_ng, apt_preferences and cryptsetup roles.
Let people know there's a script so cool.