Skip to content

Commit

Permalink
Merge pull request docker-library#429 from infosiftr/multiarch
Browse files Browse the repository at this point in the history
Add explicit "--build" to our "./configure" invocations
  • Loading branch information
yosifkit authored May 10, 2017
2 parents 3712f02 + 6844e71 commit 83ae04e
Show file tree
Hide file tree
Showing 45 changed files with 327 additions and 10 deletions.
9 changes: 9 additions & 0 deletions 5.6/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ FROM debian:jessie
# persistent / runtime deps
ENV PHPIZE_DEPS \
autoconf \
dpkg-dev \
file \
g++ \
gcc \
Expand Down Expand Up @@ -88,6 +89,7 @@ RUN set -xe \
$PHP_EXTRA_BUILD_DEPS \
libcurl4-openssl-dev \
libedit-dev \
libpcre3-dev \
libsqlite3-dev \
libssl-dev \
libxml2-dev \
Expand All @@ -99,7 +101,9 @@ RUN set -xe \
LDFLAGS="$PHP_LDFLAGS" \
&& docker-php-source extract \
&& cd /usr/src/php \
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
&& ./configure \
--build="$gnuArch" \
--with-config-file-path="$PHP_INI_DIR" \
--with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
\
Expand All @@ -117,6 +121,11 @@ RUN set -xe \
--with-openssl \
--with-zlib \
\
# bundled pcre is too old for s390x (which isn't exactly a good sign)
# /usr/src/php/ext/pcre/pcrelib/pcre_jit_compile.c:65:2: error: #error Unsupported architecture
--with-pcre-regex=/usr \
--with-libdir="lib/$gnuArch" \
\
$PHP_EXTRA_CONFIGURE_ARGS \
&& make -j "$(nproc)" \
&& make install \
Expand Down
11 changes: 10 additions & 1 deletion 5.6/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ FROM alpine:3.4
# persistent / runtime deps
ENV PHPIZE_DEPS \
autoconf \
dpkg-dev dpkg \
file \
g++ \
gcc \
Expand Down Expand Up @@ -89,18 +90,22 @@ COPY docker-php-source /usr/local/bin/
RUN set -xe \
&& apk add --no-cache --virtual .build-deps \
$PHPIZE_DEPS \
coreutils \
curl-dev \
libedit-dev \
libxml2-dev \
openssl-dev \
pcre-dev \
sqlite-dev \
\
&& export CFLAGS="$PHP_CFLAGS" \
CPPFLAGS="$PHP_CPPFLAGS" \
LDFLAGS="$PHP_LDFLAGS" \
&& docker-php-source extract \
&& cd /usr/src/php \
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
&& ./configure \
--build="$gnuArch" \
--with-config-file-path="$PHP_INI_DIR" \
--with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
\
Expand All @@ -118,8 +123,12 @@ RUN set -xe \
--with-openssl \
--with-zlib \
\
# bundled pcre is too old for s390x (which isn't exactly a good sign)
# /usr/src/php/ext/pcre/pcrelib/pcre_jit_compile.c:65:2: error: #error Unsupported architecture
--with-pcre-regex=/usr \
\
$PHP_EXTRA_CONFIGURE_ARGS \
&& make -j "$(getconf _NPROCESSORS_ONLN)" \
&& make -j "$(nproc)" \
&& make install \
&& { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \
&& make clean \
Expand Down
5 changes: 5 additions & 0 deletions 5.6/alpine/docker-php-ext-configure
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ if [ "$pm" = 'apk' ]; then
fi
fi

if command -v dpkg-architecture > /dev/null; then
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"
set -- --build="$gnuArch" "$@"
fi

set -x
cd "$ext"
phpize
Expand Down
9 changes: 9 additions & 0 deletions 5.6/apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ FROM debian:jessie
# persistent / runtime deps
ENV PHPIZE_DEPS \
autoconf \
dpkg-dev \
file \
g++ \
gcc \
Expand Down Expand Up @@ -147,6 +148,7 @@ RUN set -xe \
$PHP_EXTRA_BUILD_DEPS \
libcurl4-openssl-dev \
libedit-dev \
libpcre3-dev \
libsqlite3-dev \
libssl-dev \
libxml2-dev \
Expand All @@ -158,7 +160,9 @@ RUN set -xe \
LDFLAGS="$PHP_LDFLAGS" \
&& docker-php-source extract \
&& cd /usr/src/php \
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
&& ./configure \
--build="$gnuArch" \
--with-config-file-path="$PHP_INI_DIR" \
--with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
\
Expand All @@ -176,6 +180,11 @@ RUN set -xe \
--with-openssl \
--with-zlib \
\
# bundled pcre is too old for s390x (which isn't exactly a good sign)
# /usr/src/php/ext/pcre/pcrelib/pcre_jit_compile.c:65:2: error: #error Unsupported architecture
--with-pcre-regex=/usr \
--with-libdir="lib/$gnuArch" \
\
$PHP_EXTRA_CONFIGURE_ARGS \
&& make -j "$(nproc)" \
&& make install \
Expand Down
5 changes: 5 additions & 0 deletions 5.6/apache/docker-php-ext-configure
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ if [ "$pm" = 'apk' ]; then
fi
fi

if command -v dpkg-architecture > /dev/null; then
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"
set -- --build="$gnuArch" "$@"
fi

set -x
cd "$ext"
phpize
Expand Down
5 changes: 5 additions & 0 deletions 5.6/docker-php-ext-configure
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ if [ "$pm" = 'apk' ]; then
fi
fi

if command -v dpkg-architecture > /dev/null; then
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"
set -- --build="$gnuArch" "$@"
fi

set -x
cd "$ext"
phpize
Expand Down
9 changes: 9 additions & 0 deletions 5.6/fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ FROM debian:jessie
# persistent / runtime deps
ENV PHPIZE_DEPS \
autoconf \
dpkg-dev \
file \
g++ \
gcc \
Expand Down Expand Up @@ -89,6 +90,7 @@ RUN set -xe \
$PHP_EXTRA_BUILD_DEPS \
libcurl4-openssl-dev \
libedit-dev \
libpcre3-dev \
libsqlite3-dev \
libssl-dev \
libxml2-dev \
Expand All @@ -100,7 +102,9 @@ RUN set -xe \
LDFLAGS="$PHP_LDFLAGS" \
&& docker-php-source extract \
&& cd /usr/src/php \
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
&& ./configure \
--build="$gnuArch" \
--with-config-file-path="$PHP_INI_DIR" \
--with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
\
Expand All @@ -118,6 +122,11 @@ RUN set -xe \
--with-openssl \
--with-zlib \
\
# bundled pcre is too old for s390x (which isn't exactly a good sign)
# /usr/src/php/ext/pcre/pcrelib/pcre_jit_compile.c:65:2: error: #error Unsupported architecture
--with-pcre-regex=/usr \
--with-libdir="lib/$gnuArch" \
\
$PHP_EXTRA_CONFIGURE_ARGS \
&& make -j "$(nproc)" \
&& make install \
Expand Down
11 changes: 10 additions & 1 deletion 5.6/fpm/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ FROM alpine:3.4
# persistent / runtime deps
ENV PHPIZE_DEPS \
autoconf \
dpkg-dev dpkg \
file \
g++ \
gcc \
Expand Down Expand Up @@ -90,18 +91,22 @@ COPY docker-php-source /usr/local/bin/
RUN set -xe \
&& apk add --no-cache --virtual .build-deps \
$PHPIZE_DEPS \
coreutils \
curl-dev \
libedit-dev \
libxml2-dev \
openssl-dev \
pcre-dev \
sqlite-dev \
\
&& export CFLAGS="$PHP_CFLAGS" \
CPPFLAGS="$PHP_CPPFLAGS" \
LDFLAGS="$PHP_LDFLAGS" \
&& docker-php-source extract \
&& cd /usr/src/php \
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
&& ./configure \
--build="$gnuArch" \
--with-config-file-path="$PHP_INI_DIR" \
--with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
\
Expand All @@ -119,8 +124,12 @@ RUN set -xe \
--with-openssl \
--with-zlib \
\
# bundled pcre is too old for s390x (which isn't exactly a good sign)
# /usr/src/php/ext/pcre/pcrelib/pcre_jit_compile.c:65:2: error: #error Unsupported architecture
--with-pcre-regex=/usr \
\
$PHP_EXTRA_CONFIGURE_ARGS \
&& make -j "$(getconf _NPROCESSORS_ONLN)" \
&& make -j "$(nproc)" \
&& make install \
&& { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \
&& make clean \
Expand Down
5 changes: 5 additions & 0 deletions 5.6/fpm/alpine/docker-php-ext-configure
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ if [ "$pm" = 'apk' ]; then
fi
fi

if command -v dpkg-architecture > /dev/null; then
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"
set -- --build="$gnuArch" "$@"
fi

set -x
cd "$ext"
phpize
Expand Down
5 changes: 5 additions & 0 deletions 5.6/fpm/docker-php-ext-configure
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ if [ "$pm" = 'apk' ]; then
fi
fi

if command -v dpkg-architecture > /dev/null; then
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"
set -- --build="$gnuArch" "$@"
fi

set -x
cd "$ext"
phpize
Expand Down
9 changes: 9 additions & 0 deletions 5.6/zts/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ FROM debian:jessie
# persistent / runtime deps
ENV PHPIZE_DEPS \
autoconf \
dpkg-dev \
file \
g++ \
gcc \
Expand Down Expand Up @@ -89,6 +90,7 @@ RUN set -xe \
$PHP_EXTRA_BUILD_DEPS \
libcurl4-openssl-dev \
libedit-dev \
libpcre3-dev \
libsqlite3-dev \
libssl-dev \
libxml2-dev \
Expand All @@ -100,7 +102,9 @@ RUN set -xe \
LDFLAGS="$PHP_LDFLAGS" \
&& docker-php-source extract \
&& cd /usr/src/php \
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
&& ./configure \
--build="$gnuArch" \
--with-config-file-path="$PHP_INI_DIR" \
--with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
\
Expand All @@ -118,6 +122,11 @@ RUN set -xe \
--with-openssl \
--with-zlib \
\
# bundled pcre is too old for s390x (which isn't exactly a good sign)
# /usr/src/php/ext/pcre/pcrelib/pcre_jit_compile.c:65:2: error: #error Unsupported architecture
--with-pcre-regex=/usr \
--with-libdir="lib/$gnuArch" \
\
$PHP_EXTRA_CONFIGURE_ARGS \
&& make -j "$(nproc)" \
&& make install \
Expand Down
11 changes: 10 additions & 1 deletion 5.6/zts/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ FROM alpine:3.4
# persistent / runtime deps
ENV PHPIZE_DEPS \
autoconf \
dpkg-dev dpkg \
file \
g++ \
gcc \
Expand Down Expand Up @@ -90,18 +91,22 @@ COPY docker-php-source /usr/local/bin/
RUN set -xe \
&& apk add --no-cache --virtual .build-deps \
$PHPIZE_DEPS \
coreutils \
curl-dev \
libedit-dev \
libxml2-dev \
openssl-dev \
pcre-dev \
sqlite-dev \
\
&& export CFLAGS="$PHP_CFLAGS" \
CPPFLAGS="$PHP_CPPFLAGS" \
LDFLAGS="$PHP_LDFLAGS" \
&& docker-php-source extract \
&& cd /usr/src/php \
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
&& ./configure \
--build="$gnuArch" \
--with-config-file-path="$PHP_INI_DIR" \
--with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
\
Expand All @@ -119,8 +124,12 @@ RUN set -xe \
--with-openssl \
--with-zlib \
\
# bundled pcre is too old for s390x (which isn't exactly a good sign)
# /usr/src/php/ext/pcre/pcrelib/pcre_jit_compile.c:65:2: error: #error Unsupported architecture
--with-pcre-regex=/usr \
\
$PHP_EXTRA_CONFIGURE_ARGS \
&& make -j "$(getconf _NPROCESSORS_ONLN)" \
&& make -j "$(nproc)" \
&& make install \
&& { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \
&& make clean \
Expand Down
5 changes: 5 additions & 0 deletions 5.6/zts/alpine/docker-php-ext-configure
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ if [ "$pm" = 'apk' ]; then
fi
fi

if command -v dpkg-architecture > /dev/null; then
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"
set -- --build="$gnuArch" "$@"
fi

set -x
cd "$ext"
phpize
Expand Down
5 changes: 5 additions & 0 deletions 5.6/zts/docker-php-ext-configure
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ if [ "$pm" = 'apk' ]; then
fi
fi

if command -v dpkg-architecture > /dev/null; then
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"
set -- --build="$gnuArch" "$@"
fi

set -x
cd "$ext"
phpize
Expand Down
Loading

0 comments on commit 83ae04e

Please sign in to comment.