Skip to content

Commit ad9b781

Browse files
committed
Merge pull request #41 from infosiftr/keep-the-sauce
Keep the source and instead just "make clean"
2 parents 0e97c6b + 2c58801 commit ad9b781

21 files changed

+610
-66
lines changed

5.4/Dockerfile

+15-11
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,28 @@ FROM debian:jessie
33
# persistent / runtime deps
44
RUN apt-get update && apt-get install -y ca-certificates curl libxml2 --no-install-recommends && rm -r /var/lib/apt/lists/*
55

6+
# phpize deps
7+
RUN apt-get update && apt-get install -y autoconf gcc pkg-config --no-install-recommends && rm -r /var/lib/apt/lists/*
8+
9+
ENV PHP_INI_DIR /usr/local/etc/php
10+
RUN mkdir -p $PHP_INI_DIR/conf.d
11+
612
##<autogenerated>##
713
##</autogenerated>##
814

915
RUN gpg --keyserver pgp.mit.edu --recv-keys F38252826ACD957EF380D39F2F7956BC5DA04B5D
1016

1117
ENV PHP_VERSION 5.4.34
1218

19+
# --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)
1320
RUN buildDeps=" \
1421
$PHP_EXTRA_BUILD_DEPS \
15-
build-essential \
1622
bzip2 \
1723
file \
1824
libcurl4-openssl-dev \
19-
libpng12-dev \
2025
libreadline6-dev \
2126
libssl-dev \
2227
libxml2-dev \
23-
m4 \
24-
pkg-config \
2528
"; \
2629
set -x \
2730
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
@@ -32,22 +35,23 @@ RUN buildDeps=" \
3235
&& tar -xf php.tar.bz2 -C /usr/src/php --strip-components=1 \
3336
&& rm php.tar.bz2* \
3437
&& cd /usr/src/php \
35-
&& ./configure --disable-cgi \
38+
&& ./configure \
39+
--with-config-file-path="$PHP_INI_DIR" \
40+
--with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
3641
$PHP_EXTRA_CONFIGURE_ARGS \
37-
--enable-soap \
42+
--disable-cgi \
43+
--enable-mysqlnd \
3844
--with-curl \
39-
--with-gd \
40-
--with-mysql \
41-
--with-mysqli \
4245
--with-openssl \
43-
--with-pdo-mysql \
4446
--with-readline \
4547
--with-zlib \
4648
&& make -j"$(nproc)" \
4749
&& make install \
4850
&& { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \
4951
&& apt-get purge -y --auto-remove $buildDeps \
50-
&& rm -r /usr/src/php
52+
&& make clean
53+
54+
COPY docker-php-ext-* /usr/local/bin/
5155

5256
##<autogenerated>##
5357
CMD ["php", "-a"]

5.4/apache/Dockerfile

+15-11
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ FROM debian:jessie
33
# persistent / runtime deps
44
RUN apt-get update && apt-get install -y ca-certificates curl libxml2 --no-install-recommends && rm -r /var/lib/apt/lists/*
55

6+
# phpize deps
7+
RUN apt-get update && apt-get install -y autoconf gcc pkg-config --no-install-recommends && rm -r /var/lib/apt/lists/*
8+
9+
ENV PHP_INI_DIR /usr/local/etc/php
10+
RUN mkdir -p $PHP_INI_DIR/conf.d
11+
612
##<autogenerated>##
713
RUN apt-get update && apt-get install -y apache2-bin apache2.2-common --no-install-recommends && rm -rf /var/lib/apt/lists/*
814

@@ -23,18 +29,15 @@ RUN gpg --keyserver pgp.mit.edu --recv-keys F38252826ACD957EF380D39F2F7956BC5DA0
2329

2430
ENV PHP_VERSION 5.4.34
2531

32+
# --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)
2633
RUN buildDeps=" \
2734
$PHP_EXTRA_BUILD_DEPS \
28-
build-essential \
2935
bzip2 \
3036
file \
3137
libcurl4-openssl-dev \
32-
libpng12-dev \
3338
libreadline6-dev \
3439
libssl-dev \
3540
libxml2-dev \
36-
m4 \
37-
pkg-config \
3841
"; \
3942
set -x \
4043
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
@@ -45,22 +48,23 @@ RUN buildDeps=" \
4548
&& tar -xf php.tar.bz2 -C /usr/src/php --strip-components=1 \
4649
&& rm php.tar.bz2* \
4750
&& cd /usr/src/php \
48-
&& ./configure --disable-cgi \
51+
&& ./configure \
52+
--with-config-file-path="$PHP_INI_DIR" \
53+
--with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
4954
$PHP_EXTRA_CONFIGURE_ARGS \
50-
--enable-soap \
55+
--disable-cgi \
56+
--enable-mysqlnd \
5157
--with-curl \
52-
--with-gd \
53-
--with-mysql \
54-
--with-mysqli \
5558
--with-openssl \
56-
--with-pdo-mysql \
5759
--with-readline \
5860
--with-zlib \
5961
&& make -j"$(nproc)" \
6062
&& make install \
6163
&& { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \
6264
&& apt-get purge -y --auto-remove $buildDeps \
63-
&& rm -r /usr/src/php
65+
&& make clean
66+
67+
COPY docker-php-ext-* /usr/local/bin/
6468

6569
##<autogenerated>##
6670
WORKDIR /var/www/html

5.4/apache/docker-php-ext-configure

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
set -e
3+
4+
ext="$1"
5+
extDir="/usr/src/php/ext/$ext"
6+
if [ -z "$ext" -o ! -d "$extDir" ]; then
7+
echo >&2 "usage: $0 ext-name [configure flags]"
8+
echo >&2 " ie: $0 gd --with-jpeg-dir=/usr/local/something"
9+
echo >&2
10+
echo >&2 'Possible values for ext-name:'
11+
echo >&2 $(find /usr/src/php/ext -mindepth 2 -maxdepth 2 -type f -name 'config.m4' | cut -d/ -f6 | sort)
12+
exit 1
13+
fi
14+
shift
15+
16+
set -x
17+
cd "$extDir"
18+
phpize
19+
./configure "$@"

5.4/apache/docker-php-ext-install

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/bin/bash
2+
set -e
3+
4+
cd /usr/src/php/ext
5+
6+
usage() {
7+
echo "usage: $0 ext-name [ext-name ...]"
8+
echo " ie: $0 gd mysqli"
9+
echo " $0 pdo pdo_mysql"
10+
echo
11+
echo 'if custom ./configure arguments are necessary, see docker-php-ext-configure'
12+
echo
13+
echo 'Possible values for ext-name:'
14+
echo $(find /usr/src/php/ext -mindepth 2 -maxdepth 2 -type f -name 'config.m4' | cut -d/ -f6 | sort)
15+
}
16+
17+
exts=()
18+
while [ $# -gt 0 ]; do
19+
ext="$1"
20+
shift
21+
if [ -z "$ext" ]; then
22+
continue
23+
fi
24+
if [ ! -d "$ext" ]; then
25+
echo >&2 "error: $(pwd -P)/$ext does not exist"
26+
echo >&2
27+
usage >&2
28+
exit 1
29+
fi
30+
exts+=( "$ext" )
31+
done
32+
33+
if [ "${#exts[@]}" -eq 0 ]; then
34+
usage >&2
35+
exit 1
36+
fi
37+
38+
for ext in "${exts[@]}"; do
39+
(
40+
cd "$ext"
41+
[ -e Makefile ] || docker-php-ext-configure "$ext"
42+
make
43+
make install
44+
ini="/usr/local/etc/php/conf.d/docker-php-ext-$ext.ini"
45+
for module in modules/*.so; do
46+
if [ -f "$module" ]; then
47+
line="extension=$(basename "$module")"
48+
if ! grep -q "$line" "$ini"; then
49+
echo "$line" >> "/usr/local/etc/php/conf.d/ext-$ext.ini"
50+
fi
51+
fi
52+
done
53+
make clean
54+
)
55+
done

5.4/docker-php-ext-configure

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
set -e
3+
4+
ext="$1"
5+
extDir="/usr/src/php/ext/$ext"
6+
if [ -z "$ext" -o ! -d "$extDir" ]; then
7+
echo >&2 "usage: $0 ext-name [configure flags]"
8+
echo >&2 " ie: $0 gd --with-jpeg-dir=/usr/local/something"
9+
echo >&2
10+
echo >&2 'Possible values for ext-name:'
11+
echo >&2 $(find /usr/src/php/ext -mindepth 2 -maxdepth 2 -type f -name 'config.m4' | cut -d/ -f6 | sort)
12+
exit 1
13+
fi
14+
shift
15+
16+
set -x
17+
cd "$extDir"
18+
phpize
19+
./configure "$@"

5.4/docker-php-ext-install

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/bin/bash
2+
set -e
3+
4+
cd /usr/src/php/ext
5+
6+
usage() {
7+
echo "usage: $0 ext-name [ext-name ...]"
8+
echo " ie: $0 gd mysqli"
9+
echo " $0 pdo pdo_mysql"
10+
echo
11+
echo 'if custom ./configure arguments are necessary, see docker-php-ext-configure'
12+
echo
13+
echo 'Possible values for ext-name:'
14+
echo $(find /usr/src/php/ext -mindepth 2 -maxdepth 2 -type f -name 'config.m4' | cut -d/ -f6 | sort)
15+
}
16+
17+
exts=()
18+
while [ $# -gt 0 ]; do
19+
ext="$1"
20+
shift
21+
if [ -z "$ext" ]; then
22+
continue
23+
fi
24+
if [ ! -d "$ext" ]; then
25+
echo >&2 "error: $(pwd -P)/$ext does not exist"
26+
echo >&2
27+
usage >&2
28+
exit 1
29+
fi
30+
exts+=( "$ext" )
31+
done
32+
33+
if [ "${#exts[@]}" -eq 0 ]; then
34+
usage >&2
35+
exit 1
36+
fi
37+
38+
for ext in "${exts[@]}"; do
39+
(
40+
cd "$ext"
41+
[ -e Makefile ] || docker-php-ext-configure "$ext"
42+
make
43+
make install
44+
ini="/usr/local/etc/php/conf.d/docker-php-ext-$ext.ini"
45+
for module in modules/*.so; do
46+
if [ -f "$module" ]; then
47+
line="extension=$(basename "$module")"
48+
if ! grep -q "$line" "$ini"; then
49+
echo "$line" >> "/usr/local/etc/php/conf.d/ext-$ext.ini"
50+
fi
51+
fi
52+
done
53+
make clean
54+
)
55+
done

5.5/Dockerfile

+15-11
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,28 @@ FROM debian:jessie
33
# persistent / runtime deps
44
RUN apt-get update && apt-get install -y ca-certificates curl libxml2 --no-install-recommends && rm -r /var/lib/apt/lists/*
55

6+
# phpize deps
7+
RUN apt-get update && apt-get install -y autoconf gcc pkg-config --no-install-recommends && rm -r /var/lib/apt/lists/*
8+
9+
ENV PHP_INI_DIR /usr/local/etc/php
10+
RUN mkdir -p $PHP_INI_DIR/conf.d
11+
612
##<autogenerated>##
713
##</autogenerated>##
814

915
RUN gpg --keyserver pgp.mit.edu --recv-keys 0BD78B5F97500D450838F95DFE857D9A90D90EC1 0B96609E270F565C13292B24C13C70B87267B52D
1016

1117
ENV PHP_VERSION 5.5.18
1218

19+
# --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)
1320
RUN buildDeps=" \
1421
$PHP_EXTRA_BUILD_DEPS \
15-
build-essential \
1622
bzip2 \
1723
file \
1824
libcurl4-openssl-dev \
19-
libpng12-dev \
2025
libreadline6-dev \
2126
libssl-dev \
2227
libxml2-dev \
23-
m4 \
24-
pkg-config \
2528
"; \
2629
set -x \
2730
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
@@ -32,22 +35,23 @@ RUN buildDeps=" \
3235
&& tar -xf php.tar.bz2 -C /usr/src/php --strip-components=1 \
3336
&& rm php.tar.bz2* \
3437
&& cd /usr/src/php \
35-
&& ./configure --disable-cgi \
38+
&& ./configure \
39+
--with-config-file-path="$PHP_INI_DIR" \
40+
--with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
3641
$PHP_EXTRA_CONFIGURE_ARGS \
37-
--enable-soap \
42+
--disable-cgi \
43+
--enable-mysqlnd \
3844
--with-curl \
39-
--with-gd \
40-
--with-mysql \
41-
--with-mysqli \
4245
--with-openssl \
43-
--with-pdo-mysql \
4446
--with-readline \
4547
--with-zlib \
4648
&& make -j"$(nproc)" \
4749
&& make install \
4850
&& { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \
4951
&& apt-get purge -y --auto-remove $buildDeps \
50-
&& rm -r /usr/src/php
52+
&& make clean
53+
54+
COPY docker-php-ext-* /usr/local/bin/
5155

5256
##<autogenerated>##
5357
CMD ["php", "-a"]

0 commit comments

Comments
 (0)