Skip to content

Commit a413eb0

Browse files
committed
Switch from "bz2" to "xz" for 5.5 and 5.6 (several megabytes smaller download)
1 parent ae130b2 commit a413eb0

File tree

7 files changed

+48
-37
lines changed

7 files changed

+48
-37
lines changed

5.5/Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,23 @@ ENV PHP_VERSION 5.5.26
2323
# --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)
2424
RUN buildDeps=" \
2525
$PHP_EXTRA_BUILD_DEPS \
26-
bzip2 \
2726
libcurl4-openssl-dev \
2827
libpcre3-dev \
2928
libreadline6-dev \
3029
librecode-dev \
3130
libsqlite3-dev \
3231
libssl-dev \
3332
libxml2-dev \
33+
xz-utils \
3434
" \
3535
&& set -x \
3636
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
37-
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.bz2/from/this/mirror" -o php.tar.bz2 \
38-
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.bz2.asc/from/this/mirror" -o php.tar.bz2.asc \
39-
&& gpg --verify php.tar.bz2.asc \
37+
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.xz/from/this/mirror" -o php.tar.xz \
38+
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.xz.asc/from/this/mirror" -o php.tar.xz.asc \
39+
&& gpg --verify php.tar.xz.asc \
4040
&& mkdir -p /usr/src/php \
41-
&& tar -xof php.tar.bz2 -C /usr/src/php --strip-components=1 \
42-
&& rm php.tar.bz2* \
41+
&& tar -xof php.tar.xz -C /usr/src/php --strip-components=1 \
42+
&& rm php.tar.xz* \
4343
&& cd /usr/src/php \
4444
&& ./configure \
4545
--with-config-file-path="$PHP_INI_DIR" \

5.5/apache/Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,23 +36,23 @@ ENV PHP_VERSION 5.5.26
3636
# --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)
3737
RUN buildDeps=" \
3838
$PHP_EXTRA_BUILD_DEPS \
39-
bzip2 \
4039
libcurl4-openssl-dev \
4140
libpcre3-dev \
4241
libreadline6-dev \
4342
librecode-dev \
4443
libsqlite3-dev \
4544
libssl-dev \
4645
libxml2-dev \
46+
xz-utils \
4747
" \
4848
&& set -x \
4949
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
50-
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.bz2/from/this/mirror" -o php.tar.bz2 \
51-
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.bz2.asc/from/this/mirror" -o php.tar.bz2.asc \
52-
&& gpg --verify php.tar.bz2.asc \
50+
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.xz/from/this/mirror" -o php.tar.xz \
51+
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.xz.asc/from/this/mirror" -o php.tar.xz.asc \
52+
&& gpg --verify php.tar.xz.asc \
5353
&& mkdir -p /usr/src/php \
54-
&& tar -xof php.tar.bz2 -C /usr/src/php --strip-components=1 \
55-
&& rm php.tar.bz2* \
54+
&& tar -xof php.tar.xz -C /usr/src/php --strip-components=1 \
55+
&& rm php.tar.xz* \
5656
&& cd /usr/src/php \
5757
&& ./configure \
5858
--with-config-file-path="$PHP_INI_DIR" \

5.5/fpm/Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,23 @@ ENV PHP_VERSION 5.5.26
2424
# --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)
2525
RUN buildDeps=" \
2626
$PHP_EXTRA_BUILD_DEPS \
27-
bzip2 \
2827
libcurl4-openssl-dev \
2928
libpcre3-dev \
3029
libreadline6-dev \
3130
librecode-dev \
3231
libsqlite3-dev \
3332
libssl-dev \
3433
libxml2-dev \
34+
xz-utils \
3535
" \
3636
&& set -x \
3737
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
38-
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.bz2/from/this/mirror" -o php.tar.bz2 \
39-
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.bz2.asc/from/this/mirror" -o php.tar.bz2.asc \
40-
&& gpg --verify php.tar.bz2.asc \
38+
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.xz/from/this/mirror" -o php.tar.xz \
39+
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.xz.asc/from/this/mirror" -o php.tar.xz.asc \
40+
&& gpg --verify php.tar.xz.asc \
4141
&& mkdir -p /usr/src/php \
42-
&& tar -xof php.tar.bz2 -C /usr/src/php --strip-components=1 \
43-
&& rm php.tar.bz2* \
42+
&& tar -xof php.tar.xz -C /usr/src/php --strip-components=1 \
43+
&& rm php.tar.xz* \
4444
&& cd /usr/src/php \
4545
&& ./configure \
4646
--with-config-file-path="$PHP_INI_DIR" \

5.6/Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,23 @@ ENV PHP_VERSION 5.6.10
2323
# --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)
2424
RUN buildDeps=" \
2525
$PHP_EXTRA_BUILD_DEPS \
26-
bzip2 \
2726
libcurl4-openssl-dev \
2827
libpcre3-dev \
2928
libreadline6-dev \
3029
librecode-dev \
3130
libsqlite3-dev \
3231
libssl-dev \
3332
libxml2-dev \
33+
xz-utils \
3434
" \
3535
&& set -x \
3636
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
37-
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.bz2/from/this/mirror" -o php.tar.bz2 \
38-
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.bz2.asc/from/this/mirror" -o php.tar.bz2.asc \
39-
&& gpg --verify php.tar.bz2.asc \
37+
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.xz/from/this/mirror" -o php.tar.xz \
38+
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.xz.asc/from/this/mirror" -o php.tar.xz.asc \
39+
&& gpg --verify php.tar.xz.asc \
4040
&& mkdir -p /usr/src/php \
41-
&& tar -xof php.tar.bz2 -C /usr/src/php --strip-components=1 \
42-
&& rm php.tar.bz2* \
41+
&& tar -xof php.tar.xz -C /usr/src/php --strip-components=1 \
42+
&& rm php.tar.xz* \
4343
&& cd /usr/src/php \
4444
&& ./configure \
4545
--with-config-file-path="$PHP_INI_DIR" \

5.6/apache/Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,23 +36,23 @@ ENV PHP_VERSION 5.6.10
3636
# --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)
3737
RUN buildDeps=" \
3838
$PHP_EXTRA_BUILD_DEPS \
39-
bzip2 \
4039
libcurl4-openssl-dev \
4140
libpcre3-dev \
4241
libreadline6-dev \
4342
librecode-dev \
4443
libsqlite3-dev \
4544
libssl-dev \
4645
libxml2-dev \
46+
xz-utils \
4747
" \
4848
&& set -x \
4949
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
50-
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.bz2/from/this/mirror" -o php.tar.bz2 \
51-
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.bz2.asc/from/this/mirror" -o php.tar.bz2.asc \
52-
&& gpg --verify php.tar.bz2.asc \
50+
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.xz/from/this/mirror" -o php.tar.xz \
51+
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.xz.asc/from/this/mirror" -o php.tar.xz.asc \
52+
&& gpg --verify php.tar.xz.asc \
5353
&& mkdir -p /usr/src/php \
54-
&& tar -xof php.tar.bz2 -C /usr/src/php --strip-components=1 \
55-
&& rm php.tar.bz2* \
54+
&& tar -xof php.tar.xz -C /usr/src/php --strip-components=1 \
55+
&& rm php.tar.xz* \
5656
&& cd /usr/src/php \
5757
&& ./configure \
5858
--with-config-file-path="$PHP_INI_DIR" \

5.6/fpm/Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,23 @@ ENV PHP_VERSION 5.6.10
2424
# --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)
2525
RUN buildDeps=" \
2626
$PHP_EXTRA_BUILD_DEPS \
27-
bzip2 \
2827
libcurl4-openssl-dev \
2928
libpcre3-dev \
3029
libreadline6-dev \
3130
librecode-dev \
3231
libsqlite3-dev \
3332
libssl-dev \
3433
libxml2-dev \
34+
xz-utils \
3535
" \
3636
&& set -x \
3737
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
38-
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.bz2/from/this/mirror" -o php.tar.bz2 \
39-
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.bz2.asc/from/this/mirror" -o php.tar.bz2.asc \
40-
&& gpg --verify php.tar.bz2.asc \
38+
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.xz/from/this/mirror" -o php.tar.xz \
39+
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.xz.asc/from/this/mirror" -o php.tar.xz.asc \
40+
&& gpg --verify php.tar.xz.asc \
4141
&& mkdir -p /usr/src/php \
42-
&& tar -xof php.tar.bz2 -C /usr/src/php --strip-components=1 \
43-
&& rm php.tar.bz2* \
42+
&& tar -xof php.tar.xz -C /usr/src/php --strip-components=1 \
43+
&& rm php.tar.xz* \
4444
&& cd /usr/src/php \
4545
&& ./configure \
4646
--with-config-file-path="$PHP_INI_DIR" \

update.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,18 @@ packages="$(echo "$packagesUrl" | sed -r 's/[^a-zA-Z.-]+/-/g')"
2323
curl -sSL "${packagesUrl}" > "$packages"
2424

2525
for version in "${versions[@]}"; do
26-
fullVersion="$(sed 's/;/;\n/g' $packages | grep -e 'php-'"$version"'.*\.tar\.bz2' | sed -r 's/.*php-('"$version"'[^"]+)\.tar\.bz2.*/\1/' | sort -V | tail -1)"
26+
fullVersion=''
27+
for comp in xz bz2; do
28+
fullVersion="$(sed 's/;/;\n/g' $packages | grep -e 'php-'"$version"'.*\.tar\.'"$comp" | sed -r 's/.*php-('"$version"'[^"]+)\.tar\.'"$comp"'.*/\1/' | sort -V | tail -1)"
29+
if [ "$fullVersion" ]; then
30+
break
31+
fi
32+
done
33+
if [ -z "$fullVersion" ]; then
34+
echo >&2 "ERROR: missing $version in $packagesUrl"
35+
continue
36+
fi
37+
2738
gpgKey="${gpgKeys[$version]}"
2839
if [ -z "$gpgKey" ]; then
2940
echo >&2 "ERROR: missing GPG key fingerprint for $version"

0 commit comments

Comments
 (0)