Skip to content

Commit aa5f145

Browse files
ReactDevs007web-flow
authored andcommitted
Merge pull request #296 from infosiftr/7.1
Add PHP 7.1.0RC1
2 parents 0ad3235 + 572bcb8 commit aa5f145

38 files changed

+2864
-0
lines changed

.travis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@ language: bash
22
services: docker
33

44
env:
5+
- VERSION=7.1 VARIANT=
6+
- VERSION=7.1 VARIANT=alpine
7+
- VERSION=7.1 VARIANT=apache
8+
- VERSION=7.1 VARIANT=fpm
9+
- VERSION=7.1 VARIANT=fpm/alpine
10+
- VERSION=7.1 VARIANT=zts
11+
- VERSION=7.1 VARIANT=zts/alpine
512
- VERSION=7.0 VARIANT=
613
- VERSION=7.0 VARIANT=alpine
714
- VERSION=7.0 VARIANT=apache

7.1/Dockerfile

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
#
2+
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
3+
#
4+
# PLEASE DO NOT EDIT IT DIRECTLY.
5+
#
6+
7+
FROM debian:jessie
8+
9+
# persistent / runtime deps
10+
ENV PHPIZE_DEPS \
11+
autoconf \
12+
file \
13+
g++ \
14+
gcc \
15+
libc-dev \
16+
make \
17+
pkg-config \
18+
re2c
19+
RUN apt-get update && apt-get install -y \
20+
$PHPIZE_DEPS \
21+
ca-certificates \
22+
curl \
23+
libedit2 \
24+
libsqlite3-0 \
25+
libxml2 \
26+
xz-utils \
27+
--no-install-recommends && rm -r /var/lib/apt/lists/*
28+
29+
ENV PHP_INI_DIR /usr/local/etc/php
30+
RUN mkdir -p $PHP_INI_DIR/conf.d
31+
32+
##<autogenerated>##
33+
##</autogenerated>##
34+
35+
ENV GPG_KEYS A917B1ECDA84AEC2B568FED6F50ABC807BD5DCD0
36+
37+
ENV PHP_VERSION 7.1.0RC1
38+
ENV PHP_FILENAME php-7.1.0RC1.tar.xz
39+
40+
RUN set -xe \
41+
&& cd /usr/src \
42+
&& curl -fSL "https://downloads.php.net/~davey/$PHP_FILENAME" -o php.tar.xz \
43+
&& curl -fSL "https://downloads.php.net/~davey/$PHP_FILENAME.asc" -o php.tar.xz.asc \
44+
&& export GNUPGHOME="$(mktemp -d)" \
45+
&& for key in $GPG_KEYS; do \
46+
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \
47+
done \
48+
&& gpg --batch --verify php.tar.xz.asc php.tar.xz \
49+
&& rm -r "$GNUPGHOME"
50+
51+
COPY docker-php-source /usr/local/bin/
52+
53+
RUN set -xe \
54+
&& buildDeps=" \
55+
$PHP_EXTRA_BUILD_DEPS \
56+
libcurl4-openssl-dev \
57+
libedit-dev \
58+
libsqlite3-dev \
59+
libssl-dev \
60+
libxml2-dev \
61+
" \
62+
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
63+
\
64+
&& docker-php-source extract \
65+
&& cd /usr/src/php \
66+
&& ./configure \
67+
--with-config-file-path="$PHP_INI_DIR" \
68+
--with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
69+
\
70+
--disable-cgi \
71+
\
72+
# --enable-ftp is included here because ftp_ssl_connect() needs ftp to be compiled statically (see https://github.com/docker-library/php/issues/236)
73+
--enable-ftp \
74+
# --enable-mbstring is included here because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195)
75+
--enable-mbstring \
76+
# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself)
77+
--enable-mysqlnd \
78+
\
79+
--with-curl \
80+
--with-libedit \
81+
--with-openssl \
82+
--with-zlib \
83+
\
84+
$PHP_EXTRA_CONFIGURE_ARGS \
85+
&& make -j"$(nproc)" \
86+
&& make install \
87+
&& { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \
88+
&& make clean \
89+
&& docker-php-source delete \
90+
\
91+
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $buildDeps
92+
93+
COPY docker-php-ext-* /usr/local/bin/
94+
95+
##<autogenerated>##
96+
CMD ["php", "-a"]
97+
##</autogenerated>##

7.1/alpine/Dockerfile

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
#
2+
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
3+
#
4+
# PLEASE DO NOT EDIT IT DIRECTLY.
5+
#
6+
7+
FROM alpine:3.4
8+
9+
# persistent / runtime deps
10+
ENV PHPIZE_DEPS \
11+
autoconf \
12+
file \
13+
g++ \
14+
gcc \
15+
libc-dev \
16+
make \
17+
pkgconf \
18+
re2c
19+
RUN apk add --no-cache --virtual .persistent-deps \
20+
ca-certificates \
21+
curl \
22+
tar \
23+
xz
24+
25+
# ensure www-data user exists
26+
RUN set -x \
27+
&& addgroup -g 82 -S www-data \
28+
&& adduser -u 82 -D -S -G www-data www-data
29+
# 82 is the standard uid/gid for "www-data" in Alpine
30+
# http://git.alpinelinux.org/cgit/aports/tree/main/apache2/apache2.pre-install?h=v3.3.2
31+
# http://git.alpinelinux.org/cgit/aports/tree/main/lighttpd/lighttpd.pre-install?h=v3.3.2
32+
# http://git.alpinelinux.org/cgit/aports/tree/main/nginx-initscripts/nginx-initscripts.pre-install?h=v3.3.2
33+
34+
ENV PHP_INI_DIR /usr/local/etc/php
35+
RUN mkdir -p $PHP_INI_DIR/conf.d
36+
37+
##<autogenerated>##
38+
##</autogenerated>##
39+
40+
ENV GPG_KEYS A917B1ECDA84AEC2B568FED6F50ABC807BD5DCD0
41+
42+
ENV PHP_VERSION 7.1.0RC1
43+
ENV PHP_FILENAME php-7.1.0RC1.tar.xz
44+
45+
RUN set -xe \
46+
&& apk add --no-cache --virtual .fetch-deps \
47+
gnupg \
48+
&& mkdir -p /usr/src \
49+
&& cd /usr/src \
50+
&& curl -fSL "https://downloads.php.net/~davey/$PHP_FILENAME" -o php.tar.xz \
51+
&& curl -fSL "https://downloads.php.net/~davey/$PHP_FILENAME.asc" -o php.tar.xz.asc \
52+
&& export GNUPGHOME="$(mktemp -d)" \
53+
&& for key in $GPG_KEYS; do \
54+
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \
55+
done \
56+
&& gpg --batch --verify php.tar.xz.asc php.tar.xz \
57+
&& rm -r "$GNUPGHOME" \
58+
&& apk del .fetch-deps
59+
60+
COPY docker-php-source /usr/local/bin/
61+
62+
RUN set -xe \
63+
&& apk add --no-cache --virtual .build-deps \
64+
$PHPIZE_DEPS \
65+
curl-dev \
66+
libedit-dev \
67+
libxml2-dev \
68+
openssl-dev \
69+
sqlite-dev \
70+
\
71+
&& docker-php-source extract \
72+
&& cd /usr/src/php \
73+
&& ./configure \
74+
--with-config-file-path="$PHP_INI_DIR" \
75+
--with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
76+
\
77+
--disable-cgi \
78+
\
79+
# --enable-ftp is included here because ftp_ssl_connect() needs ftp to be compiled statically (see https://github.com/docker-library/php/issues/236)
80+
--enable-ftp \
81+
# --enable-mbstring is included here because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195)
82+
--enable-mbstring \
83+
# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself)
84+
--enable-mysqlnd \
85+
\
86+
--with-curl \
87+
--with-libedit \
88+
--with-openssl \
89+
--with-zlib \
90+
\
91+
$PHP_EXTRA_CONFIGURE_ARGS \
92+
&& make -j"$(getconf _NPROCESSORS_ONLN)" \
93+
&& make install \
94+
&& { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \
95+
&& make clean \
96+
&& docker-php-source delete \
97+
\
98+
&& runDeps="$( \
99+
scanelf --needed --nobanner --recursive /usr/local \
100+
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
101+
| sort -u \
102+
| xargs -r apk info --installed \
103+
| sort -u \
104+
)" \
105+
&& apk add --no-cache --virtual .php-rundeps $runDeps \
106+
\
107+
&& apk del .build-deps
108+
109+
COPY docker-php-ext-* /usr/local/bin/
110+
111+
##<autogenerated>##
112+
CMD ["php", "-a"]
113+
##</autogenerated>##

7.1/alpine/docker-php-ext-configure

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/bin/sh
2+
set -e
3+
4+
srcExists=
5+
if [ -d /usr/src/php ]; then
6+
srcExists=1
7+
fi
8+
docker-php-source extract
9+
if [ -z "$srcExists" ]; then
10+
touch /usr/src/php/.docker-delete-me
11+
fi
12+
13+
ext="$1"
14+
extDir="/usr/src/php/ext/$ext"
15+
if [ -z "$ext" ] || [ ! -d "$extDir" ]; then
16+
echo >&2 "usage: $0 ext-name [configure flags]"
17+
echo >&2 " ie: $0 gd --with-jpeg-dir=/usr/local/something"
18+
echo >&2
19+
echo >&2 'Possible values for ext-name:'
20+
find /usr/src/php/ext \
21+
-mindepth 2 \
22+
-maxdepth 2 \
23+
-type f \
24+
-name 'config.m4' \
25+
| xargs -n1 dirname \
26+
| xargs -n1 basename \
27+
| sort \
28+
| xargs
29+
exit 1
30+
fi
31+
shift
32+
33+
pm='unknown'
34+
if [ -e /lib/apk/db/installed ]; then
35+
pm='apk'
36+
fi
37+
38+
if [ "$pm" = 'apk' ]; then
39+
if \
40+
[ -n "$PHPIZE_DEPS" ] \
41+
&& ! apk info --installed .phpize-deps > /dev/null \
42+
&& ! apk info --installed .phpize-deps-configure > /dev/null \
43+
; then
44+
apk add --no-cache --virtual .phpize-deps-configure $PHPIZE_DEPS
45+
fi
46+
fi
47+
48+
set -x
49+
cd "$extDir"
50+
phpize
51+
./configure "$@"

7.1/alpine/docker-php-ext-enable

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
#!/bin/sh
2+
set -e
3+
4+
cd "$(php -r 'echo ini_get("extension_dir");')"
5+
6+
usage() {
7+
echo "usage: $0 [options] module-name [module-name ...]"
8+
echo " ie: $0 gd mysqli"
9+
echo " $0 pdo pdo_mysql"
10+
echo " $0 --ini-name 0-apc.ini apcu apc"
11+
echo
12+
echo 'Possible values for module-name:'
13+
echo $(find -maxdepth 1 -type f -name '*.so' -exec basename '{}' ';' | sort)
14+
}
15+
16+
opts="$(getopt -o 'h?' --long 'help,ini-name:' -- "$@" || { usage >&2 && false; })"
17+
eval set -- "$opts"
18+
19+
iniName=
20+
while true; do
21+
flag="$1"
22+
shift
23+
case "$flag" in
24+
--help|-h|'-?') usage && exit 0 ;;
25+
--ini-name) iniName="$1" && shift ;;
26+
--) break ;;
27+
*)
28+
{
29+
echo "error: unknown flag: $flag"
30+
usage
31+
} >&2
32+
exit 1
33+
;;
34+
esac
35+
done
36+
37+
modules=
38+
for module; do
39+
if [ -z "$module" ]; then
40+
continue
41+
fi
42+
if [ -f "$module.so" ] && ! [ -f "$module" ]; then
43+
# allow ".so" to be optional
44+
module="$module.so"
45+
fi
46+
if ! [ -f "$module" ]; then
47+
echo >&2 "error: $(readlink -f "$module") does not exist"
48+
echo >&2
49+
usage >&2
50+
exit 1
51+
fi
52+
modules="$modules $module"
53+
done
54+
55+
if [ -z "$modules" ]; then
56+
usage >&2
57+
exit 1
58+
fi
59+
60+
for module in $modules; do
61+
if nm -g "$module" | grep -q ' zend_extension_entry$'; then
62+
# https://wiki.php.net/internals/extensions#loading_zend_extensions
63+
line="zend_extension=$(readlink -f "$module")"
64+
else
65+
line="extension=$module"
66+
fi
67+
68+
ext="$(basename "$module")"
69+
ext="${ext%.*}"
70+
if php -r 'exit(extension_loaded("'"$ext"'") ? 0 : 1);'; then
71+
# this isn't perfect, but it's better than nothing
72+
# (for example, 'opcache.so' presents inside PHP as 'Zend OPcache', not 'opcache')
73+
echo >&2
74+
echo >&2 "warning: $ext ($module) is already loaded!"
75+
echo >&2
76+
continue
77+
fi
78+
79+
ini="/usr/local/etc/php/conf.d/${iniName:-"docker-php-ext-$ext.ini"}"
80+
if ! grep -q "$line" "$ini" 2>/dev/null; then
81+
echo "$line" >> "$ini"
82+
fi
83+
done

0 commit comments

Comments
 (0)