Merge pull request #41 from infosiftr/keep-the-sauce

Keep the source and instead just "make clean"
This commit is contained in:
yosifkit 2014-11-11 17:24:02 -07:00
commit ad9b781547
21 changed files with 610 additions and 66 deletions

View File

@ -3,6 +3,12 @@ FROM debian:jessie
# persistent / runtime deps
RUN apt-get update && apt-get install -y ca-certificates curl libxml2 --no-install-recommends && rm -r /var/lib/apt/lists/*
# phpize deps
RUN apt-get update && apt-get install -y autoconf gcc pkg-config --no-install-recommends && rm -r /var/lib/apt/lists/*
ENV PHP_INI_DIR /usr/local/etc/php
RUN mkdir -p $PHP_INI_DIR/conf.d
##<autogenerated>##
##</autogenerated>##
@ -10,18 +16,15 @@ RUN gpg --keyserver pgp.mit.edu --recv-keys F38252826ACD957EF380D39F2F7956BC5DA0
ENV PHP_VERSION 5.4.34
# --enable-mysqlnd is included below because it's harder to compile after the fact the extensions are (since it's a plugin for several extensions, not an extension in itself)
RUN buildDeps=" \
$PHP_EXTRA_BUILD_DEPS \
build-essential \
bzip2 \
file \
libcurl4-openssl-dev \
libpng12-dev \
libreadline6-dev \
libssl-dev \
libxml2-dev \
m4 \
pkg-config \
"; \
set -x \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
@ -32,22 +35,23 @@ RUN buildDeps=" \
&& tar -xf php.tar.bz2 -C /usr/src/php --strip-components=1 \
&& rm php.tar.bz2* \
&& cd /usr/src/php \
&& ./configure --disable-cgi \
&& ./configure \
--with-config-file-path="$PHP_INI_DIR" \
--with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
$PHP_EXTRA_CONFIGURE_ARGS \
--enable-soap \
--disable-cgi \
--enable-mysqlnd \
--with-curl \
--with-gd \
--with-mysql \
--with-mysqli \
--with-openssl \
--with-pdo-mysql \
--with-readline \
--with-zlib \
&& make -j"$(nproc)" \
&& make install \
&& { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \
&& apt-get purge -y --auto-remove $buildDeps \
&& rm -r /usr/src/php
&& make clean
COPY docker-php-ext-* /usr/local/bin/
##<autogenerated>##
CMD ["php", "-a"]

View File

@ -3,6 +3,12 @@ FROM debian:jessie
# persistent / runtime deps
RUN apt-get update && apt-get install -y ca-certificates curl libxml2 --no-install-recommends && rm -r /var/lib/apt/lists/*
# phpize deps
RUN apt-get update && apt-get install -y autoconf gcc pkg-config --no-install-recommends && rm -r /var/lib/apt/lists/*
ENV PHP_INI_DIR /usr/local/etc/php
RUN mkdir -p $PHP_INI_DIR/conf.d
##<autogenerated>##
RUN apt-get update && apt-get install -y apache2-bin apache2.2-common --no-install-recommends && rm -rf /var/lib/apt/lists/*
@ -23,18 +29,15 @@ RUN gpg --keyserver pgp.mit.edu --recv-keys F38252826ACD957EF380D39F2F7956BC5DA0
ENV PHP_VERSION 5.4.34
# --enable-mysqlnd is included below because it's harder to compile after the fact the extensions are (since it's a plugin for several extensions, not an extension in itself)
RUN buildDeps=" \
$PHP_EXTRA_BUILD_DEPS \
build-essential \
bzip2 \
file \
libcurl4-openssl-dev \
libpng12-dev \
libreadline6-dev \
libssl-dev \
libxml2-dev \
m4 \
pkg-config \
"; \
set -x \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
@ -45,22 +48,23 @@ RUN buildDeps=" \
&& tar -xf php.tar.bz2 -C /usr/src/php --strip-components=1 \
&& rm php.tar.bz2* \
&& cd /usr/src/php \
&& ./configure --disable-cgi \
&& ./configure \
--with-config-file-path="$PHP_INI_DIR" \
--with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
$PHP_EXTRA_CONFIGURE_ARGS \
--enable-soap \
--disable-cgi \
--enable-mysqlnd \
--with-curl \
--with-gd \
--with-mysql \
--with-mysqli \
--with-openssl \
--with-pdo-mysql \
--with-readline \
--with-zlib \
&& make -j"$(nproc)" \
&& make install \
&& { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \
&& apt-get purge -y --auto-remove $buildDeps \
&& rm -r /usr/src/php
&& make clean
COPY docker-php-ext-* /usr/local/bin/
##<autogenerated>##
WORKDIR /var/www/html

View File

@ -0,0 +1,19 @@
#!/bin/bash
set -e
ext="$1"
extDir="/usr/src/php/ext/$ext"
if [ -z "$ext" -o ! -d "$extDir" ]; then
echo >&2 "usage: $0 ext-name [configure flags]"
echo >&2 " ie: $0 gd --with-jpeg-dir=/usr/local/something"
echo >&2
echo >&2 'Possible values for ext-name:'
echo >&2 $(find /usr/src/php/ext -mindepth 2 -maxdepth 2 -type f -name 'config.m4' | cut -d/ -f6 | sort)
exit 1
fi
shift
set -x
cd "$extDir"
phpize
./configure "$@"

View File

@ -0,0 +1,55 @@
#!/bin/bash
set -e
cd /usr/src/php/ext
usage() {
echo "usage: $0 ext-name [ext-name ...]"
echo " ie: $0 gd mysqli"
echo " $0 pdo pdo_mysql"
echo
echo 'if custom ./configure arguments are necessary, see docker-php-ext-configure'
echo
echo 'Possible values for ext-name:'
echo $(find /usr/src/php/ext -mindepth 2 -maxdepth 2 -type f -name 'config.m4' | cut -d/ -f6 | sort)
}
exts=()
while [ $# -gt 0 ]; do
ext="$1"
shift
if [ -z "$ext" ]; then
continue
fi
if [ ! -d "$ext" ]; then
echo >&2 "error: $(pwd -P)/$ext does not exist"
echo >&2
usage >&2
exit 1
fi
exts+=( "$ext" )
done
if [ "${#exts[@]}" -eq 0 ]; then
usage >&2
exit 1
fi
for ext in "${exts[@]}"; do
(
cd "$ext"
[ -e Makefile ] || docker-php-ext-configure "$ext"
make
make install
ini="/usr/local/etc/php/conf.d/docker-php-ext-$ext.ini"
for module in modules/*.so; do
if [ -f "$module" ]; then
line="extension=$(basename "$module")"
if ! grep -q "$line" "$ini"; then
echo "$line" >> "/usr/local/etc/php/conf.d/ext-$ext.ini"
fi
fi
done
make clean
)
done

19
5.4/docker-php-ext-configure Executable file
View File

@ -0,0 +1,19 @@
#!/bin/bash
set -e
ext="$1"
extDir="/usr/src/php/ext/$ext"
if [ -z "$ext" -o ! -d "$extDir" ]; then
echo >&2 "usage: $0 ext-name [configure flags]"
echo >&2 " ie: $0 gd --with-jpeg-dir=/usr/local/something"
echo >&2
echo >&2 'Possible values for ext-name:'
echo >&2 $(find /usr/src/php/ext -mindepth 2 -maxdepth 2 -type f -name 'config.m4' | cut -d/ -f6 | sort)
exit 1
fi
shift
set -x
cd "$extDir"
phpize
./configure "$@"

55
5.4/docker-php-ext-install Executable file
View File

@ -0,0 +1,55 @@
#!/bin/bash
set -e
cd /usr/src/php/ext
usage() {
echo "usage: $0 ext-name [ext-name ...]"
echo " ie: $0 gd mysqli"
echo " $0 pdo pdo_mysql"
echo
echo 'if custom ./configure arguments are necessary, see docker-php-ext-configure'
echo
echo 'Possible values for ext-name:'
echo $(find /usr/src/php/ext -mindepth 2 -maxdepth 2 -type f -name 'config.m4' | cut -d/ -f6 | sort)
}
exts=()
while [ $# -gt 0 ]; do
ext="$1"
shift
if [ -z "$ext" ]; then
continue
fi
if [ ! -d "$ext" ]; then
echo >&2 "error: $(pwd -P)/$ext does not exist"
echo >&2
usage >&2
exit 1
fi
exts+=( "$ext" )
done
if [ "${#exts[@]}" -eq 0 ]; then
usage >&2
exit 1
fi
for ext in "${exts[@]}"; do
(
cd "$ext"
[ -e Makefile ] || docker-php-ext-configure "$ext"
make
make install
ini="/usr/local/etc/php/conf.d/docker-php-ext-$ext.ini"
for module in modules/*.so; do
if [ -f "$module" ]; then
line="extension=$(basename "$module")"
if ! grep -q "$line" "$ini"; then
echo "$line" >> "/usr/local/etc/php/conf.d/ext-$ext.ini"
fi
fi
done
make clean
)
done

View File

@ -3,6 +3,12 @@ FROM debian:jessie
# persistent / runtime deps
RUN apt-get update && apt-get install -y ca-certificates curl libxml2 --no-install-recommends && rm -r /var/lib/apt/lists/*
# phpize deps
RUN apt-get update && apt-get install -y autoconf gcc pkg-config --no-install-recommends && rm -r /var/lib/apt/lists/*
ENV PHP_INI_DIR /usr/local/etc/php
RUN mkdir -p $PHP_INI_DIR/conf.d
##<autogenerated>##
##</autogenerated>##
@ -10,18 +16,15 @@ RUN gpg --keyserver pgp.mit.edu --recv-keys 0BD78B5F97500D450838F95DFE857D9A90D9
ENV PHP_VERSION 5.5.18
# --enable-mysqlnd is included below because it's harder to compile after the fact the extensions are (since it's a plugin for several extensions, not an extension in itself)
RUN buildDeps=" \
$PHP_EXTRA_BUILD_DEPS \
build-essential \
bzip2 \
file \
libcurl4-openssl-dev \
libpng12-dev \
libreadline6-dev \
libssl-dev \
libxml2-dev \
m4 \
pkg-config \
"; \
set -x \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
@ -32,22 +35,23 @@ RUN buildDeps=" \
&& tar -xf php.tar.bz2 -C /usr/src/php --strip-components=1 \
&& rm php.tar.bz2* \
&& cd /usr/src/php \
&& ./configure --disable-cgi \
&& ./configure \
--with-config-file-path="$PHP_INI_DIR" \
--with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
$PHP_EXTRA_CONFIGURE_ARGS \
--enable-soap \
--disable-cgi \
--enable-mysqlnd \
--with-curl \
--with-gd \
--with-mysql \
--with-mysqli \
--with-openssl \
--with-pdo-mysql \
--with-readline \
--with-zlib \
&& make -j"$(nproc)" \
&& make install \
&& { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \
&& apt-get purge -y --auto-remove $buildDeps \
&& rm -r /usr/src/php
&& make clean
COPY docker-php-ext-* /usr/local/bin/
##<autogenerated>##
CMD ["php", "-a"]

View File

@ -3,6 +3,12 @@ FROM debian:jessie
# persistent / runtime deps
RUN apt-get update && apt-get install -y ca-certificates curl libxml2 --no-install-recommends && rm -r /var/lib/apt/lists/*
# phpize deps
RUN apt-get update && apt-get install -y autoconf gcc pkg-config --no-install-recommends && rm -r /var/lib/apt/lists/*
ENV PHP_INI_DIR /usr/local/etc/php
RUN mkdir -p $PHP_INI_DIR/conf.d
##<autogenerated>##
RUN apt-get update && apt-get install -y apache2-bin apache2.2-common --no-install-recommends && rm -rf /var/lib/apt/lists/*
@ -23,18 +29,15 @@ RUN gpg --keyserver pgp.mit.edu --recv-keys 0BD78B5F97500D450838F95DFE857D9A90D9
ENV PHP_VERSION 5.5.18
# --enable-mysqlnd is included below because it's harder to compile after the fact the extensions are (since it's a plugin for several extensions, not an extension in itself)
RUN buildDeps=" \
$PHP_EXTRA_BUILD_DEPS \
build-essential \
bzip2 \
file \
libcurl4-openssl-dev \
libpng12-dev \
libreadline6-dev \
libssl-dev \
libxml2-dev \
m4 \
pkg-config \
"; \
set -x \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
@ -45,22 +48,23 @@ RUN buildDeps=" \
&& tar -xf php.tar.bz2 -C /usr/src/php --strip-components=1 \
&& rm php.tar.bz2* \
&& cd /usr/src/php \
&& ./configure --disable-cgi \
&& ./configure \
--with-config-file-path="$PHP_INI_DIR" \
--with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
$PHP_EXTRA_CONFIGURE_ARGS \
--enable-soap \
--disable-cgi \
--enable-mysqlnd \
--with-curl \
--with-gd \
--with-mysql \
--with-mysqli \
--with-openssl \
--with-pdo-mysql \
--with-readline \
--with-zlib \
&& make -j"$(nproc)" \
&& make install \
&& { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \
&& apt-get purge -y --auto-remove $buildDeps \
&& rm -r /usr/src/php
&& make clean
COPY docker-php-ext-* /usr/local/bin/
##<autogenerated>##
WORKDIR /var/www/html

View File

@ -0,0 +1,19 @@
#!/bin/bash
set -e
ext="$1"
extDir="/usr/src/php/ext/$ext"
if [ -z "$ext" -o ! -d "$extDir" ]; then
echo >&2 "usage: $0 ext-name [configure flags]"
echo >&2 " ie: $0 gd --with-jpeg-dir=/usr/local/something"
echo >&2
echo >&2 'Possible values for ext-name:'
echo >&2 $(find /usr/src/php/ext -mindepth 2 -maxdepth 2 -type f -name 'config.m4' | cut -d/ -f6 | sort)
exit 1
fi
shift
set -x
cd "$extDir"
phpize
./configure "$@"

View File

@ -0,0 +1,55 @@
#!/bin/bash
set -e
cd /usr/src/php/ext
usage() {
echo "usage: $0 ext-name [ext-name ...]"
echo " ie: $0 gd mysqli"
echo " $0 pdo pdo_mysql"
echo
echo 'if custom ./configure arguments are necessary, see docker-php-ext-configure'
echo
echo 'Possible values for ext-name:'
echo $(find /usr/src/php/ext -mindepth 2 -maxdepth 2 -type f -name 'config.m4' | cut -d/ -f6 | sort)
}
exts=()
while [ $# -gt 0 ]; do
ext="$1"
shift
if [ -z "$ext" ]; then
continue
fi
if [ ! -d "$ext" ]; then
echo >&2 "error: $(pwd -P)/$ext does not exist"
echo >&2
usage >&2
exit 1
fi
exts+=( "$ext" )
done
if [ "${#exts[@]}" -eq 0 ]; then
usage >&2
exit 1
fi
for ext in "${exts[@]}"; do
(
cd "$ext"
[ -e Makefile ] || docker-php-ext-configure "$ext"
make
make install
ini="/usr/local/etc/php/conf.d/docker-php-ext-$ext.ini"
for module in modules/*.so; do
if [ -f "$module" ]; then
line="extension=$(basename "$module")"
if ! grep -q "$line" "$ini"; then
echo "$line" >> "/usr/local/etc/php/conf.d/ext-$ext.ini"
fi
fi
done
make clean
)
done

19
5.5/docker-php-ext-configure Executable file
View File

@ -0,0 +1,19 @@
#!/bin/bash
set -e
ext="$1"
extDir="/usr/src/php/ext/$ext"
if [ -z "$ext" -o ! -d "$extDir" ]; then
echo >&2 "usage: $0 ext-name [configure flags]"
echo >&2 " ie: $0 gd --with-jpeg-dir=/usr/local/something"
echo >&2
echo >&2 'Possible values for ext-name:'
echo >&2 $(find /usr/src/php/ext -mindepth 2 -maxdepth 2 -type f -name 'config.m4' | cut -d/ -f6 | sort)
exit 1
fi
shift
set -x
cd "$extDir"
phpize
./configure "$@"

55
5.5/docker-php-ext-install Executable file
View File

@ -0,0 +1,55 @@
#!/bin/bash
set -e
cd /usr/src/php/ext
usage() {
echo "usage: $0 ext-name [ext-name ...]"
echo " ie: $0 gd mysqli"
echo " $0 pdo pdo_mysql"
echo
echo 'if custom ./configure arguments are necessary, see docker-php-ext-configure'
echo
echo 'Possible values for ext-name:'
echo $(find /usr/src/php/ext -mindepth 2 -maxdepth 2 -type f -name 'config.m4' | cut -d/ -f6 | sort)
}
exts=()
while [ $# -gt 0 ]; do
ext="$1"
shift
if [ -z "$ext" ]; then
continue
fi
if [ ! -d "$ext" ]; then
echo >&2 "error: $(pwd -P)/$ext does not exist"
echo >&2
usage >&2
exit 1
fi
exts+=( "$ext" )
done
if [ "${#exts[@]}" -eq 0 ]; then
usage >&2
exit 1
fi
for ext in "${exts[@]}"; do
(
cd "$ext"
[ -e Makefile ] || docker-php-ext-configure "$ext"
make
make install
ini="/usr/local/etc/php/conf.d/docker-php-ext-$ext.ini"
for module in modules/*.so; do
if [ -f "$module" ]; then
line="extension=$(basename "$module")"
if ! grep -q "$line" "$ini"; then
echo "$line" >> "/usr/local/etc/php/conf.d/ext-$ext.ini"
fi
fi
done
make clean
)
done

View File

@ -3,6 +3,12 @@ FROM debian:jessie
# persistent / runtime deps
RUN apt-get update && apt-get install -y ca-certificates curl libxml2 --no-install-recommends && rm -r /var/lib/apt/lists/*
# phpize deps
RUN apt-get update && apt-get install -y autoconf gcc pkg-config --no-install-recommends && rm -r /var/lib/apt/lists/*
ENV PHP_INI_DIR /usr/local/etc/php
RUN mkdir -p $PHP_INI_DIR/conf.d
##<autogenerated>##
##</autogenerated>##
@ -10,18 +16,15 @@ RUN gpg --keyserver pgp.mit.edu --recv-keys 6E4F6AB321FDC07F2C332E3AC2BF0BC433CF
ENV PHP_VERSION 5.6.2
# --enable-mysqlnd is included below because it's harder to compile after the fact the extensions are (since it's a plugin for several extensions, not an extension in itself)
RUN buildDeps=" \
$PHP_EXTRA_BUILD_DEPS \
build-essential \
bzip2 \
file \
libcurl4-openssl-dev \
libpng12-dev \
libreadline6-dev \
libssl-dev \
libxml2-dev \
m4 \
pkg-config \
"; \
set -x \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
@ -32,22 +35,23 @@ RUN buildDeps=" \
&& tar -xf php.tar.bz2 -C /usr/src/php --strip-components=1 \
&& rm php.tar.bz2* \
&& cd /usr/src/php \
&& ./configure --disable-cgi \
&& ./configure \
--with-config-file-path="$PHP_INI_DIR" \
--with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
$PHP_EXTRA_CONFIGURE_ARGS \
--enable-soap \
--disable-cgi \
--enable-mysqlnd \
--with-curl \
--with-gd \
--with-mysql \
--with-mysqli \
--with-openssl \
--with-pdo-mysql \
--with-readline \
--with-zlib \
&& make -j"$(nproc)" \
&& make install \
&& { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \
&& apt-get purge -y --auto-remove $buildDeps \
&& rm -r /usr/src/php
&& make clean
COPY docker-php-ext-* /usr/local/bin/
##<autogenerated>##
CMD ["php", "-a"]

View File

@ -3,6 +3,12 @@ FROM debian:jessie
# persistent / runtime deps
RUN apt-get update && apt-get install -y ca-certificates curl libxml2 --no-install-recommends && rm -r /var/lib/apt/lists/*
# phpize deps
RUN apt-get update && apt-get install -y autoconf gcc pkg-config --no-install-recommends && rm -r /var/lib/apt/lists/*
ENV PHP_INI_DIR /usr/local/etc/php
RUN mkdir -p $PHP_INI_DIR/conf.d
##<autogenerated>##
RUN apt-get update && apt-get install -y apache2-bin apache2.2-common --no-install-recommends && rm -rf /var/lib/apt/lists/*
@ -23,18 +29,15 @@ RUN gpg --keyserver pgp.mit.edu --recv-keys 6E4F6AB321FDC07F2C332E3AC2BF0BC433CF
ENV PHP_VERSION 5.6.2
# --enable-mysqlnd is included below because it's harder to compile after the fact the extensions are (since it's a plugin for several extensions, not an extension in itself)
RUN buildDeps=" \
$PHP_EXTRA_BUILD_DEPS \
build-essential \
bzip2 \
file \
libcurl4-openssl-dev \
libpng12-dev \
libreadline6-dev \
libssl-dev \
libxml2-dev \
m4 \
pkg-config \
"; \
set -x \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
@ -45,22 +48,23 @@ RUN buildDeps=" \
&& tar -xf php.tar.bz2 -C /usr/src/php --strip-components=1 \
&& rm php.tar.bz2* \
&& cd /usr/src/php \
&& ./configure --disable-cgi \
&& ./configure \
--with-config-file-path="$PHP_INI_DIR" \
--with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
$PHP_EXTRA_CONFIGURE_ARGS \
--enable-soap \
--disable-cgi \
--enable-mysqlnd \
--with-curl \
--with-gd \
--with-mysql \
--with-mysqli \
--with-openssl \
--with-pdo-mysql \
--with-readline \
--with-zlib \
&& make -j"$(nproc)" \
&& make install \
&& { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \
&& apt-get purge -y --auto-remove $buildDeps \
&& rm -r /usr/src/php
&& make clean
COPY docker-php-ext-* /usr/local/bin/
##<autogenerated>##
WORKDIR /var/www/html

View File

@ -0,0 +1,19 @@
#!/bin/bash
set -e
ext="$1"
extDir="/usr/src/php/ext/$ext"
if [ -z "$ext" -o ! -d "$extDir" ]; then
echo >&2 "usage: $0 ext-name [configure flags]"
echo >&2 " ie: $0 gd --with-jpeg-dir=/usr/local/something"
echo >&2
echo >&2 'Possible values for ext-name:'
echo >&2 $(find /usr/src/php/ext -mindepth 2 -maxdepth 2 -type f -name 'config.m4' | cut -d/ -f6 | sort)
exit 1
fi
shift
set -x
cd "$extDir"
phpize
./configure "$@"

View File

@ -0,0 +1,55 @@
#!/bin/bash
set -e
cd /usr/src/php/ext
usage() {
echo "usage: $0 ext-name [ext-name ...]"
echo " ie: $0 gd mysqli"
echo " $0 pdo pdo_mysql"
echo
echo 'if custom ./configure arguments are necessary, see docker-php-ext-configure'
echo
echo 'Possible values for ext-name:'
echo $(find /usr/src/php/ext -mindepth 2 -maxdepth 2 -type f -name 'config.m4' | cut -d/ -f6 | sort)
}
exts=()
while [ $# -gt 0 ]; do
ext="$1"
shift
if [ -z "$ext" ]; then
continue
fi
if [ ! -d "$ext" ]; then
echo >&2 "error: $(pwd -P)/$ext does not exist"
echo >&2
usage >&2
exit 1
fi
exts+=( "$ext" )
done
if [ "${#exts[@]}" -eq 0 ]; then
usage >&2
exit 1
fi
for ext in "${exts[@]}"; do
(
cd "$ext"
[ -e Makefile ] || docker-php-ext-configure "$ext"
make
make install
ini="/usr/local/etc/php/conf.d/docker-php-ext-$ext.ini"
for module in modules/*.so; do
if [ -f "$module" ]; then
line="extension=$(basename "$module")"
if ! grep -q "$line" "$ini"; then
echo "$line" >> "/usr/local/etc/php/conf.d/ext-$ext.ini"
fi
fi
done
make clean
)
done

19
5.6/docker-php-ext-configure Executable file
View File

@ -0,0 +1,19 @@
#!/bin/bash
set -e
ext="$1"
extDir="/usr/src/php/ext/$ext"
if [ -z "$ext" -o ! -d "$extDir" ]; then
echo >&2 "usage: $0 ext-name [configure flags]"
echo >&2 " ie: $0 gd --with-jpeg-dir=/usr/local/something"
echo >&2
echo >&2 'Possible values for ext-name:'
echo >&2 $(find /usr/src/php/ext -mindepth 2 -maxdepth 2 -type f -name 'config.m4' | cut -d/ -f6 | sort)
exit 1
fi
shift
set -x
cd "$extDir"
phpize
./configure "$@"

55
5.6/docker-php-ext-install Executable file
View File

@ -0,0 +1,55 @@
#!/bin/bash
set -e
cd /usr/src/php/ext
usage() {
echo "usage: $0 ext-name [ext-name ...]"
echo " ie: $0 gd mysqli"
echo " $0 pdo pdo_mysql"
echo
echo 'if custom ./configure arguments are necessary, see docker-php-ext-configure'
echo
echo 'Possible values for ext-name:'
echo $(find /usr/src/php/ext -mindepth 2 -maxdepth 2 -type f -name 'config.m4' | cut -d/ -f6 | sort)
}
exts=()
while [ $# -gt 0 ]; do
ext="$1"
shift
if [ -z "$ext" ]; then
continue
fi
if [ ! -d "$ext" ]; then
echo >&2 "error: $(pwd -P)/$ext does not exist"
echo >&2
usage >&2
exit 1
fi
exts+=( "$ext" )
done
if [ "${#exts[@]}" -eq 0 ]; then
usage >&2
exit 1
fi
for ext in "${exts[@]}"; do
(
cd "$ext"
[ -e Makefile ] || docker-php-ext-configure "$ext"
make
make install
ini="/usr/local/etc/php/conf.d/docker-php-ext-$ext.ini"
for module in modules/*.so; do
if [ -f "$module" ]; then
line="extension=$(basename "$module")"
if ! grep -q "$line" "$ini"; then
echo "$line" >> "/usr/local/etc/php/conf.d/ext-$ext.ini"
fi
fi
done
make clean
)
done

19
docker-php-ext-configure Executable file
View File

@ -0,0 +1,19 @@
#!/bin/bash
set -e
ext="$1"
extDir="/usr/src/php/ext/$ext"
if [ -z "$ext" -o ! -d "$extDir" ]; then
echo >&2 "usage: $0 ext-name [configure flags]"
echo >&2 " ie: $0 gd --with-jpeg-dir=/usr/local/something"
echo >&2
echo >&2 'Possible values for ext-name:'
echo >&2 $(find /usr/src/php/ext -mindepth 2 -maxdepth 2 -type f -name 'config.m4' | cut -d/ -f6 | sort)
exit 1
fi
shift
set -x
cd "$extDir"
phpize
./configure "$@"

55
docker-php-ext-install Executable file
View File

@ -0,0 +1,55 @@
#!/bin/bash
set -e
cd /usr/src/php/ext
usage() {
echo "usage: $0 ext-name [ext-name ...]"
echo " ie: $0 gd mysqli"
echo " $0 pdo pdo_mysql"
echo
echo 'if custom ./configure arguments are necessary, see docker-php-ext-configure'
echo
echo 'Possible values for ext-name:'
echo $(find /usr/src/php/ext -mindepth 2 -maxdepth 2 -type f -name 'config.m4' | cut -d/ -f6 | sort)
}
exts=()
while [ $# -gt 0 ]; do
ext="$1"
shift
if [ -z "$ext" ]; then
continue
fi
if [ ! -d "$ext" ]; then
echo >&2 "error: $(pwd -P)/$ext does not exist"
echo >&2
usage >&2
exit 1
fi
exts+=( "$ext" )
done
if [ "${#exts[@]}" -eq 0 ]; then
usage >&2
exit 1
fi
for ext in "${exts[@]}"; do
(
cd "$ext"
[ -e Makefile ] || docker-php-ext-configure "$ext"
make
make install
ini="/usr/local/etc/php/conf.d/docker-php-ext-$ext.ini"
for module in modules/*.so; do
if [ -f "$module" ]; then
line="extension=$(basename "$module")"
if ! grep -q "$line" "$ini"; then
echo "$line" >> "/usr/local/etc/php/conf.d/ext-$ext.ini"
fi
fi
done
make clean
)
done

View File

@ -49,6 +49,8 @@ for version in "${versions[@]}"; do
s/^(RUN gpg .* --recv-keys) [0-9a-fA-F ]*$/\1 '"$gpgKey"'/
' "$version/Dockerfile"
cp docker-php-ext-* "$version/"
cp docker-php-ext-* "$version/apache/"
cp apache2.conf "$version/apache/"
)
done