mirror of
https://github.com/docker-library/php.git
synced 2025-07-31 20:56:26 +00:00
Install build time deps from docker-php-ext-install for alpine
We don't need the build dependencies during runtime, so we temporarily install them when building extension. This reduces image size with 50%. We also provide a PHPIZE_DEPS environment variable with the needed deps.
This commit is contained in:
@ -55,6 +55,11 @@ if [ -z "$exts" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
: ${PHPIZE_DEPS:="autoconf file g++ gcc libc-dev make pkgconf re2c"}
|
||||
if [ -e /lib/apk/db/installed ]; then
|
||||
apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS
|
||||
fi
|
||||
|
||||
for ext in $exts; do
|
||||
(
|
||||
cd "$ext"
|
||||
@ -69,3 +74,7 @@ for ext in $exts; do
|
||||
make -j"$j" clean
|
||||
)
|
||||
done
|
||||
|
||||
if [ -e /lib/apk/db/installed ]; then
|
||||
apk del .phpize-deps
|
||||
fi
|
||||
|
Reference in New Issue
Block a user