Switch from "bz2" to "xz" for 5.5 and 5.6 (several megabytes smaller download)

This commit is contained in:
Tianon Gravi 2015-06-29 16:47:09 -07:00
parent ae130b2f84
commit a413eb0123
7 changed files with 48 additions and 37 deletions

View File

@ -23,7 +23,6 @@ ENV PHP_VERSION 5.5.26
# --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 \
bzip2 \
libcurl4-openssl-dev \
libpcre3-dev \
libreadline6-dev \
@ -31,15 +30,16 @@ RUN buildDeps=" \
libsqlite3-dev \
libssl-dev \
libxml2-dev \
xz-utils \
" \
&& set -x \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.bz2/from/this/mirror" -o php.tar.bz2 \
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.bz2.asc/from/this/mirror" -o php.tar.bz2.asc \
&& gpg --verify php.tar.bz2.asc \
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.xz/from/this/mirror" -o php.tar.xz \
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.xz.asc/from/this/mirror" -o php.tar.xz.asc \
&& gpg --verify php.tar.xz.asc \
&& mkdir -p /usr/src/php \
&& tar -xof php.tar.bz2 -C /usr/src/php --strip-components=1 \
&& rm php.tar.bz2* \
&& tar -xof php.tar.xz -C /usr/src/php --strip-components=1 \
&& rm php.tar.xz* \
&& cd /usr/src/php \
&& ./configure \
--with-config-file-path="$PHP_INI_DIR" \

View File

@ -36,7 +36,6 @@ ENV PHP_VERSION 5.5.26
# --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 \
bzip2 \
libcurl4-openssl-dev \
libpcre3-dev \
libreadline6-dev \
@ -44,15 +43,16 @@ RUN buildDeps=" \
libsqlite3-dev \
libssl-dev \
libxml2-dev \
xz-utils \
" \
&& set -x \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.bz2/from/this/mirror" -o php.tar.bz2 \
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.bz2.asc/from/this/mirror" -o php.tar.bz2.asc \
&& gpg --verify php.tar.bz2.asc \
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.xz/from/this/mirror" -o php.tar.xz \
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.xz.asc/from/this/mirror" -o php.tar.xz.asc \
&& gpg --verify php.tar.xz.asc \
&& mkdir -p /usr/src/php \
&& tar -xof php.tar.bz2 -C /usr/src/php --strip-components=1 \
&& rm php.tar.bz2* \
&& tar -xof php.tar.xz -C /usr/src/php --strip-components=1 \
&& rm php.tar.xz* \
&& cd /usr/src/php \
&& ./configure \
--with-config-file-path="$PHP_INI_DIR" \

View File

@ -24,7 +24,6 @@ ENV PHP_VERSION 5.5.26
# --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 \
bzip2 \
libcurl4-openssl-dev \
libpcre3-dev \
libreadline6-dev \
@ -32,15 +31,16 @@ RUN buildDeps=" \
libsqlite3-dev \
libssl-dev \
libxml2-dev \
xz-utils \
" \
&& set -x \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.bz2/from/this/mirror" -o php.tar.bz2 \
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.bz2.asc/from/this/mirror" -o php.tar.bz2.asc \
&& gpg --verify php.tar.bz2.asc \
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.xz/from/this/mirror" -o php.tar.xz \
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.xz.asc/from/this/mirror" -o php.tar.xz.asc \
&& gpg --verify php.tar.xz.asc \
&& mkdir -p /usr/src/php \
&& tar -xof php.tar.bz2 -C /usr/src/php --strip-components=1 \
&& rm php.tar.bz2* \
&& tar -xof php.tar.xz -C /usr/src/php --strip-components=1 \
&& rm php.tar.xz* \
&& cd /usr/src/php \
&& ./configure \
--with-config-file-path="$PHP_INI_DIR" \

View File

@ -23,7 +23,6 @@ ENV PHP_VERSION 5.6.10
# --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 \
bzip2 \
libcurl4-openssl-dev \
libpcre3-dev \
libreadline6-dev \
@ -31,15 +30,16 @@ RUN buildDeps=" \
libsqlite3-dev \
libssl-dev \
libxml2-dev \
xz-utils \
" \
&& set -x \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.bz2/from/this/mirror" -o php.tar.bz2 \
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.bz2.asc/from/this/mirror" -o php.tar.bz2.asc \
&& gpg --verify php.tar.bz2.asc \
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.xz/from/this/mirror" -o php.tar.xz \
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.xz.asc/from/this/mirror" -o php.tar.xz.asc \
&& gpg --verify php.tar.xz.asc \
&& mkdir -p /usr/src/php \
&& tar -xof php.tar.bz2 -C /usr/src/php --strip-components=1 \
&& rm php.tar.bz2* \
&& tar -xof php.tar.xz -C /usr/src/php --strip-components=1 \
&& rm php.tar.xz* \
&& cd /usr/src/php \
&& ./configure \
--with-config-file-path="$PHP_INI_DIR" \

View File

@ -36,7 +36,6 @@ ENV PHP_VERSION 5.6.10
# --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 \
bzip2 \
libcurl4-openssl-dev \
libpcre3-dev \
libreadline6-dev \
@ -44,15 +43,16 @@ RUN buildDeps=" \
libsqlite3-dev \
libssl-dev \
libxml2-dev \
xz-utils \
" \
&& set -x \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.bz2/from/this/mirror" -o php.tar.bz2 \
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.bz2.asc/from/this/mirror" -o php.tar.bz2.asc \
&& gpg --verify php.tar.bz2.asc \
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.xz/from/this/mirror" -o php.tar.xz \
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.xz.asc/from/this/mirror" -o php.tar.xz.asc \
&& gpg --verify php.tar.xz.asc \
&& mkdir -p /usr/src/php \
&& tar -xof php.tar.bz2 -C /usr/src/php --strip-components=1 \
&& rm php.tar.bz2* \
&& tar -xof php.tar.xz -C /usr/src/php --strip-components=1 \
&& rm php.tar.xz* \
&& cd /usr/src/php \
&& ./configure \
--with-config-file-path="$PHP_INI_DIR" \

View File

@ -24,7 +24,6 @@ ENV PHP_VERSION 5.6.10
# --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 \
bzip2 \
libcurl4-openssl-dev \
libpcre3-dev \
libreadline6-dev \
@ -32,15 +31,16 @@ RUN buildDeps=" \
libsqlite3-dev \
libssl-dev \
libxml2-dev \
xz-utils \
" \
&& set -x \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.bz2/from/this/mirror" -o php.tar.bz2 \
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.bz2.asc/from/this/mirror" -o php.tar.bz2.asc \
&& gpg --verify php.tar.bz2.asc \
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.xz/from/this/mirror" -o php.tar.xz \
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.xz.asc/from/this/mirror" -o php.tar.xz.asc \
&& gpg --verify php.tar.xz.asc \
&& mkdir -p /usr/src/php \
&& tar -xof php.tar.bz2 -C /usr/src/php --strip-components=1 \
&& rm php.tar.bz2* \
&& tar -xof php.tar.xz -C /usr/src/php --strip-components=1 \
&& rm php.tar.xz* \
&& cd /usr/src/php \
&& ./configure \
--with-config-file-path="$PHP_INI_DIR" \

View File

@ -23,7 +23,18 @@ packages="$(echo "$packagesUrl" | sed -r 's/[^a-zA-Z.-]+/-/g')"
curl -sSL "${packagesUrl}" > "$packages"
for version in "${versions[@]}"; do
fullVersion="$(sed 's/;/;\n/g' $packages | grep -e 'php-'"$version"'.*\.tar\.bz2' | sed -r 's/.*php-('"$version"'[^"]+)\.tar\.bz2.*/\1/' | sort -V | tail -1)"
fullVersion=''
for comp in xz bz2; do
fullVersion="$(sed 's/;/;\n/g' $packages | grep -e 'php-'"$version"'.*\.tar\.'"$comp" | sed -r 's/.*php-('"$version"'[^"]+)\.tar\.'"$comp"'.*/\1/' | sort -V | tail -1)"
if [ "$fullVersion" ]; then
break
fi
done
if [ -z "$fullVersion" ]; then
echo >&2 "ERROR: missing $version in $packagesUrl"
continue
fi
gpgKey="${gpgKeys[$version]}"
if [ -z "$gpgKey" ]; then
echo >&2 "ERROR: missing GPG key fingerprint for $version"