Skip to content
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

Tool to docker-phpize #42

Closed
yosifkit opened this issue Nov 10, 2014 · 19 comments · Fixed by #41
Closed

Tool to docker-phpize #42

yosifkit opened this issue Nov 10, 2014 · 19 comments · Fixed by #41

Comments

@yosifkit
Copy link
Member

This was discussed in #39

@tianon
Copy link
Member

tianon commented Nov 10, 2014

Any ideas for a more fitting name? phpize is the pre-configure / autoconf step, so docker-phpize doesn't really convey the full meaning that this is supposed to be cd /usr/src/php/ext/$EXT && phpize && ./configure && make && make install.

@tianon
Copy link
Member

tianon commented Nov 10, 2014

docker-install-ext-module perhaps? Feels a bit wordy, but maybe that's not a bad thing.

@tianon
Copy link
Member

tianon commented Nov 10, 2014

or maybe even just docker-php-install-ext

@tianon
Copy link
Member

tianon commented Nov 10, 2014

My idea is that we'll be able to do something like:

RUN docker-php-install-ext gd mysqli

@md5
Copy link
Contributor

md5 commented Nov 10, 2014

I had the same concern. That name sounds fine to me.

At some point, that simple invocation won't work for someone who needs to pass flags to ./configure, but I suppose in that case they can just run the phpize bits themselves.

@md5
Copy link
Contributor

md5 commented Nov 10, 2014

Also, the tool should probably do a make clean as well to clean up after the build and install.

@tianon
Copy link
Member

tianon commented Nov 10, 2014

Maybe docker-php-ext-install is better. Maybe I'm just splitting hairs. 😄

@tianon
Copy link
Member

tianon commented Nov 10, 2014

Hmm, so that's a good question. Is ./configure the only place we might need arguments? If we punt on the OS-specific "packages" bit, we could do package [configure args].

@yosifkit
Copy link
Member Author

That all sounds fine to me.

@tianon
Copy link
Member

tianon commented Nov 10, 2014

I have terrible ideas. We could just add docker-php-ext-configure. It would do phpize && ./configure, optionally with arguments. In docker-php-ext-install, we check to see if we have a Makefile already. If we don't, we run docker-php-ext-configure.

In theory, this will work pretty decently since ./configure is made by phpize and ./Makefile is made by ./configure, so if we've run ./configure previously, it will "just work".

So, we could thus have something like:

RUN docker-php-ext-configure mbstring --some-esoteric-args --go-here
RUN docker-php-ext-install mbstring pdo pdo_mysql

@yosifkit
Copy link
Member Author

But then you cannot clean up and do make clean.

@tianon
Copy link
Member

tianon commented Nov 10, 2014

Why not? That would happen in -install (because make clean isn't going to delete either Makefile or configure).

Here's what I envision adding to WordPress, for example:

RUN apt-get update && apt-get install -y libpng12-dev && rm -rf /var/lib/apt/lists/* \
    && docker-php-ext-install gd mysqli \
    && apt-get purge --auto-remove -y libpng12-dev

@yosifkit
Copy link
Member Author

Ok, sounds good to me.

@tianon
Copy link
Member

tianon commented Nov 10, 2014

Lol, make install just does cp modules/* .... No "magic" there.

@tianon
Copy link
Member

tianon commented Nov 10, 2014

(so very easy to script, also -- just add /usr/local/etc/php/conf.d/$EXT.ini with extension=xxx.so for each *.so in modules)

@tianon
Copy link
Member

tianon commented Nov 10, 2014

I just did a by-hand POC with gd, and it was a screaming success. 😉

@yosifkit
Copy link
Member Author

Do we have to worry about which are enable versus with in the regular build flags?

@tianon
Copy link
Member

tianon commented Nov 10, 2014

Nope. The possible values are "directories in /usr/src/php/ext/", which are:

root@1200c131e383:/# find /usr/src/php/ext -mindepth 1 -maxdepth 1 -type d | cut -d/ -f6 | sort
bcmath
bz2
calendar
com_dotnet
ctype
curl
date
dba
dom
enchant
ereg
exif
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
imap
interbase
intl
json
ldap
libxml
mbstring
mcrypt
mssql
mysql
mysqli
mysqlnd
oci8
odbc
opcache
openssl
pcntl
pcre
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
skeleton
snmp
soap
sockets
spl
sqlite3
standard
sybase_ct
sysvmsg
sysvsem
sysvshm
tidy
tokenizer
wddx
xml
xmlreader
xmlrpc
xmlwriter
xsl
zip
zlib

@tianon
Copy link
Member

tianon commented Nov 11, 2014

Here's a more accurate list:

root@a2957855a72a:/# find /usr/src/php/ext -mindepth 2 -maxdepth 2 -type f -name 'config.m4' | cut -d/ -f6 | sort 
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants