Skip to content

Commit f016f5d

Browse files
committed
Run update.sh
1 parent 1a47630 commit f016f5d

File tree

84 files changed

+1608
-501
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+1608
-501
lines changed

5.5/Dockerfile

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ RUN apt-get update && apt-get install -y \
1717
libedit2 \
1818
libsqlite3-0 \
1919
libxml2 \
20+
xz-utils \
2021
--no-install-recommends && rm -r /var/lib/apt/lists/*
2122

2223
ENV PHP_INI_DIR /usr/local/etc/php
@@ -31,6 +32,20 @@ ENV PHP_VERSION 5.5.37
3132
ENV PHP_FILENAME php-5.5.37.tar.xz
3233
ENV PHP_SHA256 c322444fdf6d3ba26aa67d67ee32d1e815a877f35831351c83763431a80e3612
3334

35+
RUN set -xe \
36+
&& cd /usr/src/ \
37+
&& curl -fSL "http://php.net/get/$PHP_FILENAME/from/this/mirror" -o php.tar.xz \
38+
&& echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c - \
39+
&& curl -fSL "http://php.net/get/$PHP_FILENAME.asc/from/this/mirror" -o php.tar.xz.asc \
40+
&& export GNUPGHOME="$(mktemp -d)" \
41+
&& for key in $GPG_KEYS; do \
42+
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \
43+
done \
44+
&& gpg --batch --verify php.tar.xz.asc php.tar.xz \
45+
&& rm -r "$GNUPGHOME"
46+
47+
COPY docker-php-source /usr/local/bin/
48+
3449
RUN set -xe \
3550
&& buildDeps=" \
3651
$PHP_EXTRA_BUILD_DEPS \
@@ -39,21 +54,9 @@ RUN set -xe \
3954
libsqlite3-dev \
4055
libssl-dev \
4156
libxml2-dev \
42-
xz-utils \
4357
" \
4458
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
45-
&& curl -fSL "http://php.net/get/$PHP_FILENAME/from/this/mirror" -o "$PHP_FILENAME" \
46-
&& echo "$PHP_SHA256 *$PHP_FILENAME" | sha256sum -c - \
47-
&& curl -fSL "http://php.net/get/$PHP_FILENAME.asc/from/this/mirror" -o "$PHP_FILENAME.asc" \
48-
&& export GNUPGHOME="$(mktemp -d)" \
49-
&& for key in $GPG_KEYS; do \
50-
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \
51-
done \
52-
&& gpg --batch --verify "$PHP_FILENAME.asc" "$PHP_FILENAME" \
53-
&& rm -r "$GNUPGHOME" "$PHP_FILENAME.asc" \
54-
&& mkdir -p /usr/src/php \
55-
&& tar -xf "$PHP_FILENAME" -C /usr/src/php --strip-components=1 \
56-
&& rm "$PHP_FILENAME" \
59+
&& docker-php-source extract \
5760
&& cd /usr/src/php \
5861
&& ./configure \
5962
--with-config-file-path="$PHP_INI_DIR" \
@@ -72,7 +75,8 @@ RUN set -xe \
7275
&& make install \
7376
&& { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \
7477
&& make clean \
75-
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false $buildDeps
78+
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $buildDeps \
79+
&& docker-php-source delete
7680

7781
COPY docker-php-ext-* /usr/local/bin/
7882

5.5/alpine/Dockerfile

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ ENV PHPIZE_DEPS \
1212
re2c
1313
RUN apk add --no-cache --virtual .persistent-deps \
1414
ca-certificates \
15-
curl
15+
curl \
16+
tar \
17+
xz
1618

1719
# ensure www-data user exists
1820
RUN set -x \
@@ -35,28 +37,33 @@ ENV PHP_VERSION 5.5.37
3537
ENV PHP_FILENAME php-5.5.37.tar.xz
3638
ENV PHP_SHA256 c322444fdf6d3ba26aa67d67ee32d1e815a877f35831351c83763431a80e3612
3739

40+
RUN set -xe \
41+
&& apk add --no-cache --virtual .fetch-deps \
42+
gnupg \
43+
&& mkdir -p /usr/src \
44+
&& cd /usr/src/ \
45+
&& curl -fSL "http://php.net/get/$PHP_FILENAME/from/this/mirror" -o php.tar.xz \
46+
&& echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c - \
47+
&& curl -fSL "http://php.net/get/$PHP_FILENAME.asc/from/this/mirror" -o php.tar.xz.asc \
48+
&& export GNUPGHOME="$(mktemp -d)" \
49+
&& for key in $GPG_KEYS; do \
50+
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \
51+
done \
52+
&& gpg --batch --verify php.tar.xz.asc php.tar.xz \
53+
&& rm -r "$GNUPGHOME" \
54+
&& apk del .fetch-deps
55+
56+
COPY docker-php-source /usr/local/bin/
57+
3858
RUN set -xe \
3959
&& apk add --no-cache --virtual .build-deps \
4060
$PHPIZE_DEPS \
4161
curl-dev \
42-
gnupg \
4362
libedit-dev \
4463
libxml2-dev \
4564
openssl-dev \
4665
sqlite-dev \
47-
&& curl -fSL "http://php.net/get/$PHP_FILENAME/from/this/mirror" -o "$PHP_FILENAME" \
48-
&& echo "$PHP_SHA256 *$PHP_FILENAME" | sha256sum -c - \
49-
&& curl -fSL "http://php.net/get/$PHP_FILENAME.asc/from/this/mirror" -o "$PHP_FILENAME.asc" \
50-
&& export GNUPGHOME="$(mktemp -d)" \
51-
&& for key in $GPG_KEYS; do \
52-
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \
53-
done \
54-
&& gpg --batch --verify "$PHP_FILENAME.asc" "$PHP_FILENAME" \
55-
&& rm -r "$GNUPGHOME" "$PHP_FILENAME.asc" \
56-
&& mkdir -p /usr/src \
57-
&& tar -Jxf "$PHP_FILENAME" -C /usr/src \
58-
&& mv "/usr/src/php-$PHP_VERSION" /usr/src/php \
59-
&& rm "$PHP_FILENAME" \
66+
&& docker-php-source extract \
6067
&& cd /usr/src/php \
6168
&& ./configure \
6269
--with-config-file-path="$PHP_INI_DIR" \
@@ -83,7 +90,8 @@ RUN set -xe \
8390
| sort -u \
8491
)" \
8592
&& apk add --no-cache --virtual .php-rundeps $runDeps \
86-
&& apk del .build-deps
93+
&& apk del .build-deps \
94+
&& docker-php-source delete
8795

8896
COPY docker-php-ext-* /usr/local/bin/
8997

5.5/alpine/docker-php-ext-configure

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22
set -e
33

44
ext="$1"
5-
extDir="/usr/src/php/ext/$ext"
6-
if [ -z "$ext" ] || ! [ -d "$extDir" ]; then
5+
if [ -z "$ext" ] || ! grep -qE "^$ext$" /usr/src/php-available-exts; then
76
echo >&2 "usage: $0 ext-name [configure flags]"
87
echo >&2 " ie: $0 gd --with-jpeg-dir=/usr/local/something"
98
echo >&2
109
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)
10+
echo $(cat /usr/src/php-available-exts)
1211
exit 1
1312
fi
1413
shift
@@ -28,7 +27,9 @@ if [ "$pm" = 'apk' ]; then
2827
fi
2928
fi
3029

30+
docker-php-source extract
31+
3132
set -x
32-
cd "$extDir"
33+
cd "/usr/src/php/ext/$ext"
3334
phpize
3435
./configure "$@"

5.5/alpine/docker-php-ext-install

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#!/bin/sh
22
set -e
33

4-
cd /usr/src/php/ext
5-
64
usage() {
75
echo "usage: $0 [-jN] ext-name [ext-name ...]"
86
echo " ie: $0 gd mysqli"
@@ -12,7 +10,7 @@ usage() {
1210
echo 'if custom ./configure arguments are necessary, see docker-php-ext-configure'
1311
echo
1412
echo 'Possible values for ext-name:'
15-
echo $(find /usr/src/php/ext -mindepth 2 -maxdepth 2 -type f -name 'config.m4' | cut -d/ -f6 | sort)
13+
echo $(cat /usr/src/php-available-exts)
1614
}
1715

1816
opts="$(getopt -o 'h?j:' --long 'help,jobs:' -- "$@" || { usage >&2 && false; })"
@@ -41,8 +39,8 @@ for ext; do
4139
if [ -z "$ext" ]; then
4240
continue
4341
fi
44-
if [ ! -d "$ext" ]; then
45-
echo >&2 "error: $(pwd -P)/$ext does not exist"
42+
if ! grep -qE "^$ext$" /usr/src/php-available-exts; then
43+
echo >&2 "error: /usr/src/php/ext/$ext does not exist"
4644
echo >&2
4745
usage >&2
4846
exit 1
@@ -72,6 +70,9 @@ if [ "$pm" = 'apk' ]; then
7270
fi
7371
fi
7472

73+
docker-php-source extract
74+
cd /usr/src/php/ext
75+
7576
for ext in $exts; do
7677
(
7778
cd "$ext"
@@ -90,3 +91,4 @@ done
9091
if [ "$pm" = 'apk' ] && [ -n "$apkDel" ]; then
9192
apk del $apkDel
9293
fi
94+
docker-php-source delete

5.5/alpine/docker-php-source

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/sh
2+
set -e
3+
dir=/usr/src/php
4+
5+
usage() {
6+
echo "usage: $0 COMMAND"
7+
echo
8+
echo "Manage php source tarball lifecycle."
9+
echo
10+
echo "Commands:"
11+
echo " extract extract php source tarball into directory $dir if not already done."
12+
echo " delete delete extracted php source located into $dir if not already done."
13+
echo
14+
}
15+
16+
case "$1" in
17+
extract)
18+
if [ -e "$dir" -a ! -d "$dir" ] ; then
19+
echo >&2 "$dir exists and is not a directory"
20+
exit 1
21+
fi
22+
if [ ! -d "$dir" ]; then
23+
mkdir -p "$dir"
24+
tar -Jxf /usr/src/php.tar.xz -C "$dir" --strip-components=1
25+
26+
if [ ! -f /usr/src/php-available-exts ]; then
27+
find "$dir/ext" \
28+
-mindepth 2 \
29+
-maxdepth 2 \
30+
-type f \
31+
-name 'config.m4' \
32+
| xargs -n1 dirname | xargs -n1 basename | sort \
33+
> /usr/src/php-available-exts
34+
fi
35+
fi
36+
;;
37+
delete)
38+
rm -rf "$dir"
39+
;;
40+
*)
41+
usage
42+
exit 1
43+
;;
44+
esac

5.5/apache/Dockerfile

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ RUN apt-get update && apt-get install -y \
1717
libedit2 \
1818
libsqlite3-0 \
1919
libxml2 \
20+
xz-utils \
2021
--no-install-recommends && rm -r /var/lib/apt/lists/*
2122

2223
ENV PHP_INI_DIR /usr/local/etc/php
@@ -78,6 +79,20 @@ ENV PHP_VERSION 5.5.37
7879
ENV PHP_FILENAME php-5.5.37.tar.xz
7980
ENV PHP_SHA256 c322444fdf6d3ba26aa67d67ee32d1e815a877f35831351c83763431a80e3612
8081

82+
RUN set -xe \
83+
&& cd /usr/src/ \
84+
&& curl -fSL "http://php.net/get/$PHP_FILENAME/from/this/mirror" -o php.tar.xz \
85+
&& echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c - \
86+
&& curl -fSL "http://php.net/get/$PHP_FILENAME.asc/from/this/mirror" -o php.tar.xz.asc \
87+
&& export GNUPGHOME="$(mktemp -d)" \
88+
&& for key in $GPG_KEYS; do \
89+
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \
90+
done \
91+
&& gpg --batch --verify php.tar.xz.asc php.tar.xz \
92+
&& rm -r "$GNUPGHOME"
93+
94+
COPY docker-php-source /usr/local/bin/
95+
8196
RUN set -xe \
8297
&& buildDeps=" \
8398
$PHP_EXTRA_BUILD_DEPS \
@@ -86,21 +101,9 @@ RUN set -xe \
86101
libsqlite3-dev \
87102
libssl-dev \
88103
libxml2-dev \
89-
xz-utils \
90104
" \
91105
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
92-
&& curl -fSL "http://php.net/get/$PHP_FILENAME/from/this/mirror" -o "$PHP_FILENAME" \
93-
&& echo "$PHP_SHA256 *$PHP_FILENAME" | sha256sum -c - \
94-
&& curl -fSL "http://php.net/get/$PHP_FILENAME.asc/from/this/mirror" -o "$PHP_FILENAME.asc" \
95-
&& export GNUPGHOME="$(mktemp -d)" \
96-
&& for key in $GPG_KEYS; do \
97-
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \
98-
done \
99-
&& gpg --batch --verify "$PHP_FILENAME.asc" "$PHP_FILENAME" \
100-
&& rm -r "$GNUPGHOME" "$PHP_FILENAME.asc" \
101-
&& mkdir -p /usr/src/php \
102-
&& tar -xf "$PHP_FILENAME" -C /usr/src/php --strip-components=1 \
103-
&& rm "$PHP_FILENAME" \
106+
&& docker-php-source extract \
104107
&& cd /usr/src/php \
105108
&& ./configure \
106109
--with-config-file-path="$PHP_INI_DIR" \
@@ -119,7 +122,8 @@ RUN set -xe \
119122
&& make install \
120123
&& { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \
121124
&& make clean \
122-
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false $buildDeps
125+
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $buildDeps \
126+
&& docker-php-source delete
123127

124128
COPY docker-php-ext-* /usr/local/bin/
125129

5.5/apache/docker-php-ext-configure

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22
set -e
33

44
ext="$1"
5-
extDir="/usr/src/php/ext/$ext"
6-
if [ -z "$ext" ] || ! [ -d "$extDir" ]; then
5+
if [ -z "$ext" ] || ! grep -qE "^$ext$" /usr/src/php-available-exts; then
76
echo >&2 "usage: $0 ext-name [configure flags]"
87
echo >&2 " ie: $0 gd --with-jpeg-dir=/usr/local/something"
98
echo >&2
109
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)
10+
echo $(cat /usr/src/php-available-exts)
1211
exit 1
1312
fi
1413
shift
@@ -28,7 +27,9 @@ if [ "$pm" = 'apk' ]; then
2827
fi
2928
fi
3029

30+
docker-php-source extract
31+
3132
set -x
32-
cd "$extDir"
33+
cd "/usr/src/php/ext/$ext"
3334
phpize
3435
./configure "$@"

5.5/apache/docker-php-ext-install

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#!/bin/sh
22
set -e
33

4-
cd /usr/src/php/ext
5-
64
usage() {
75
echo "usage: $0 [-jN] ext-name [ext-name ...]"
86
echo " ie: $0 gd mysqli"
@@ -12,7 +10,7 @@ usage() {
1210
echo 'if custom ./configure arguments are necessary, see docker-php-ext-configure'
1311
echo
1412
echo 'Possible values for ext-name:'
15-
echo $(find /usr/src/php/ext -mindepth 2 -maxdepth 2 -type f -name 'config.m4' | cut -d/ -f6 | sort)
13+
echo $(cat /usr/src/php-available-exts)
1614
}
1715

1816
opts="$(getopt -o 'h?j:' --long 'help,jobs:' -- "$@" || { usage >&2 && false; })"
@@ -41,8 +39,8 @@ for ext; do
4139
if [ -z "$ext" ]; then
4240
continue
4341
fi
44-
if [ ! -d "$ext" ]; then
45-
echo >&2 "error: $(pwd -P)/$ext does not exist"
42+
if ! grep -qE "^$ext$" /usr/src/php-available-exts; then
43+
echo >&2 "error: /usr/src/php/ext/$ext does not exist"
4644
echo >&2
4745
usage >&2
4846
exit 1
@@ -72,6 +70,9 @@ if [ "$pm" = 'apk' ]; then
7270
fi
7371
fi
7472

73+
docker-php-source extract
74+
cd /usr/src/php/ext
75+
7576
for ext in $exts; do
7677
(
7778
cd "$ext"
@@ -90,3 +91,4 @@ done
9091
if [ "$pm" = 'apk' ] && [ -n "$apkDel" ]; then
9192
apk del $apkDel
9293
fi
94+
docker-php-source delete

0 commit comments

Comments
 (0)