Skip to content

Commit 43b47cc

Browse files
authored
Merge pull request #677 from TimWolla/php-7.3
Add PHP 7.3-rc
2 parents 475fedd + c53a180 commit 43b47cc

Some content is hidden

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

52 files changed

+4099
-14
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.3-rc VARIANT=stretch/cli
6+
- VERSION=7.3-rc VARIANT=stretch/apache
7+
- VERSION=7.3-rc VARIANT=stretch/fpm
8+
- VERSION=7.3-rc VARIANT=stretch/zts
9+
- VERSION=7.3-rc VARIANT=alpine3.8/cli
10+
- VERSION=7.3-rc VARIANT=alpine3.8/fpm
11+
- VERSION=7.3-rc VARIANT=alpine3.8/zts
512
- VERSION=7.2 VARIANT=stretch/cli
613
- VERSION=7.2 VARIANT=stretch/apache
714
- VERSION=7.2 VARIANT=stretch/fpm

7.2/stretch/apache/Dockerfile

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ RUN set -eux; \
164164
savedAptMark="$(apt-mark showmanual)"; \
165165
apt-get update; \
166166
apt-get install -y --no-install-recommends \
167-
libargon2-0-dev \
168167
libcurl4-openssl-dev \
169168
libedit-dev \
170169
libsodium-dev \
@@ -174,6 +173,20 @@ RUN set -eux; \
174173
zlib1g-dev \
175174
${PHP_EXTRA_BUILD_DEPS:-} \
176175
; \
176+
##<argon2>##
177+
sed -e 's/stretch/buster/g' /etc/apt/sources.list > /etc/apt/sources.list.d/buster.list; \
178+
{ \
179+
echo 'Package: *'; \
180+
echo 'Pin: release n=buster'; \
181+
echo 'Pin-Priority: -10'; \
182+
echo; \
183+
echo 'Package: libargon2*'; \
184+
echo 'Pin: release n=buster'; \
185+
echo 'Pin-Priority: 990'; \
186+
} > /etc/apt/preferences.d/argon2-buster; \
187+
apt-get update; \
188+
apt-get install -y --no-install-recommends libargon2-dev; \
189+
##</argon2>##
177190
rm -rf /var/lib/apt/lists/*; \
178191
\
179192
export \

7.2/stretch/cli/Dockerfile

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ RUN set -eux; \
105105
savedAptMark="$(apt-mark showmanual)"; \
106106
apt-get update; \
107107
apt-get install -y --no-install-recommends \
108-
libargon2-0-dev \
109108
libcurl4-openssl-dev \
110109
libedit-dev \
111110
libsodium-dev \
@@ -115,6 +114,20 @@ RUN set -eux; \
115114
zlib1g-dev \
116115
${PHP_EXTRA_BUILD_DEPS:-} \
117116
; \
117+
##<argon2>##
118+
sed -e 's/stretch/buster/g' /etc/apt/sources.list > /etc/apt/sources.list.d/buster.list; \
119+
{ \
120+
echo 'Package: *'; \
121+
echo 'Pin: release n=buster'; \
122+
echo 'Pin-Priority: -10'; \
123+
echo; \
124+
echo 'Package: libargon2*'; \
125+
echo 'Pin: release n=buster'; \
126+
echo 'Pin-Priority: 990'; \
127+
} > /etc/apt/preferences.d/argon2-buster; \
128+
apt-get update; \
129+
apt-get install -y --no-install-recommends libargon2-dev; \
130+
##</argon2>##
118131
rm -rf /var/lib/apt/lists/*; \
119132
\
120133
export \

7.2/stretch/fpm/Dockerfile

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ RUN set -eux; \
106106
savedAptMark="$(apt-mark showmanual)"; \
107107
apt-get update; \
108108
apt-get install -y --no-install-recommends \
109-
libargon2-0-dev \
110109
libcurl4-openssl-dev \
111110
libedit-dev \
112111
libsodium-dev \
@@ -116,6 +115,20 @@ RUN set -eux; \
116115
zlib1g-dev \
117116
${PHP_EXTRA_BUILD_DEPS:-} \
118117
; \
118+
##<argon2>##
119+
sed -e 's/stretch/buster/g' /etc/apt/sources.list > /etc/apt/sources.list.d/buster.list; \
120+
{ \
121+
echo 'Package: *'; \
122+
echo 'Pin: release n=buster'; \
123+
echo 'Pin-Priority: -10'; \
124+
echo; \
125+
echo 'Package: libargon2*'; \
126+
echo 'Pin: release n=buster'; \
127+
echo 'Pin-Priority: 990'; \
128+
} > /etc/apt/preferences.d/argon2-buster; \
129+
apt-get update; \
130+
apt-get install -y --no-install-recommends libargon2-dev; \
131+
##</argon2>##
119132
rm -rf /var/lib/apt/lists/*; \
120133
\
121134
export \

7.2/stretch/zts/Dockerfile

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ RUN set -eux; \
106106
savedAptMark="$(apt-mark showmanual)"; \
107107
apt-get update; \
108108
apt-get install -y --no-install-recommends \
109-
libargon2-0-dev \
110109
libcurl4-openssl-dev \
111110
libedit-dev \
112111
libsodium-dev \
@@ -116,6 +115,20 @@ RUN set -eux; \
116115
zlib1g-dev \
117116
${PHP_EXTRA_BUILD_DEPS:-} \
118117
; \
118+
##<argon2>##
119+
sed -e 's/stretch/buster/g' /etc/apt/sources.list > /etc/apt/sources.list.d/buster.list; \
120+
{ \
121+
echo 'Package: *'; \
122+
echo 'Pin: release n=buster'; \
123+
echo 'Pin-Priority: -10'; \
124+
echo; \
125+
echo 'Package: libargon2*'; \
126+
echo 'Pin: release n=buster'; \
127+
echo 'Pin-Priority: 990'; \
128+
} > /etc/apt/preferences.d/argon2-buster; \
129+
apt-get update; \
130+
apt-get install -y --no-install-recommends libargon2-dev; \
131+
##</argon2>##
119132
rm -rf /var/lib/apt/lists/*; \
120133
\
121134
export \

7.3-rc/alpine3.8/cli/Dockerfile

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
#
2+
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
3+
#
4+
# PLEASE DO NOT EDIT IT DIRECTLY.
5+
#
6+
7+
FROM alpine:3.8
8+
9+
# dependencies required for running "phpize"
10+
# these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed)
11+
ENV PHPIZE_DEPS \
12+
autoconf \
13+
dpkg-dev dpkg \
14+
file \
15+
g++ \
16+
gcc \
17+
libc-dev \
18+
make \
19+
pkgconf \
20+
re2c
21+
22+
# persistent / runtime deps
23+
RUN apk add --no-cache --virtual .persistent-deps \
24+
ca-certificates \
25+
curl \
26+
tar \
27+
xz \
28+
# https://github.com/docker-library/php/issues/494
29+
libressl
30+
31+
# ensure www-data user exists
32+
RUN set -x \
33+
&& addgroup -g 82 -S www-data \
34+
&& adduser -u 82 -D -S -G www-data www-data
35+
# 82 is the standard uid/gid for "www-data" in Alpine
36+
# http://git.alpinelinux.org/cgit/aports/tree/main/apache2/apache2.pre-install?h=v3.3.2
37+
# http://git.alpinelinux.org/cgit/aports/tree/main/lighttpd/lighttpd.pre-install?h=v3.3.2
38+
# http://git.alpinelinux.org/cgit/aports/tree/main/nginx-initscripts/nginx-initscripts.pre-install?h=v3.3.2
39+
40+
ENV PHP_INI_DIR /usr/local/etc/php
41+
RUN mkdir -p $PHP_INI_DIR/conf.d
42+
43+
##<autogenerated>##
44+
##</autogenerated>##
45+
46+
# Apply stack smash protection to functions using local buffers and alloca()
47+
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
48+
# Enable optimization (-O2)
49+
# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default)
50+
# Adds GNU HASH segments to generated executables (this is used if present, and is much faster than sysv hash; in this configuration, sysv hash is also generated)
51+
# https://github.com/docker-library/php/issues/272
52+
ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2"
53+
ENV PHP_CPPFLAGS="$PHP_CFLAGS"
54+
ENV PHP_LDFLAGS="-Wl,-O1 -Wl,--hash-style=both -pie"
55+
56+
ENV GPG_KEYS CBAF69F173A0FEA4B537F470D66C9593118BCCB6 F38252826ACD957EF380D39F2F7956BC5DA04B5D
57+
58+
ENV PHP_VERSION 7.3.0beta1
59+
ENV PHP_URL="https://downloads.php.net/~cmb/php-7.3.0beta1.tar.xz" PHP_ASC_URL="https://downloads.php.net/~cmb/php-7.3.0beta1.tar.xz.asc"
60+
ENV PHP_SHA256="6fc2bc65179f8228bfeab27ab01e558cfd5a1049c904243016c92414e254afcf" PHP_MD5=""
61+
62+
RUN set -xe; \
63+
\
64+
apk add --no-cache --virtual .fetch-deps \
65+
gnupg \
66+
wget \
67+
; \
68+
\
69+
mkdir -p /usr/src; \
70+
cd /usr/src; \
71+
\
72+
wget -O php.tar.xz "$PHP_URL"; \
73+
\
74+
if [ -n "$PHP_SHA256" ]; then \
75+
echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \
76+
fi; \
77+
if [ -n "$PHP_MD5" ]; then \
78+
echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; \
79+
fi; \
80+
\
81+
if [ -n "$PHP_ASC_URL" ]; then \
82+
wget -O php.tar.xz.asc "$PHP_ASC_URL"; \
83+
export GNUPGHOME="$(mktemp -d)"; \
84+
for key in $GPG_KEYS; do \
85+
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \
86+
done; \
87+
gpg --batch --verify php.tar.xz.asc php.tar.xz; \
88+
command -v gpgconf > /dev/null && gpgconf --kill all; \
89+
rm -rf "$GNUPGHOME"; \
90+
fi; \
91+
\
92+
apk del .fetch-deps
93+
94+
COPY docker-php-source /usr/local/bin/
95+
96+
RUN set -xe \
97+
&& apk add --no-cache --virtual .build-deps \
98+
$PHPIZE_DEPS \
99+
argon2-dev \
100+
coreutils \
101+
curl-dev \
102+
libedit-dev \
103+
libressl-dev \
104+
libsodium-dev \
105+
libxml2-dev \
106+
sqlite-dev \
107+
\
108+
&& export CFLAGS="$PHP_CFLAGS" \
109+
CPPFLAGS="$PHP_CPPFLAGS" \
110+
LDFLAGS="$PHP_LDFLAGS" \
111+
&& docker-php-source extract \
112+
&& cd /usr/src/php \
113+
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
114+
&& ./configure \
115+
--build="$gnuArch" \
116+
--with-config-file-path="$PHP_INI_DIR" \
117+
--with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
118+
\
119+
# make sure invalid --configure-flags are fatal errors intead of just warnings
120+
--enable-option-checking=fatal \
121+
\
122+
# https://github.com/docker-library/php/issues/439
123+
--with-mhash \
124+
\
125+
# --enable-ftp is included here because ftp_ssl_connect() needs ftp to be compiled statically (see https://github.com/docker-library/php/issues/236)
126+
--enable-ftp \
127+
# --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)
128+
--enable-mbstring \
129+
# --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)
130+
--enable-mysqlnd \
131+
# https://wiki.php.net/rfc/argon2_password_hash (7.2+)
132+
--with-password-argon2 \
133+
# https://wiki.php.net/rfc/libsodium
134+
--with-sodium=shared \
135+
\
136+
--with-curl \
137+
--with-libedit \
138+
--with-openssl \
139+
--with-zlib \
140+
\
141+
# bundled pcre does not support JIT on s390x
142+
# https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT
143+
$(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \
144+
\
145+
$PHP_EXTRA_CONFIGURE_ARGS \
146+
&& make -j "$(nproc)" \
147+
&& make install \
148+
&& { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \
149+
&& make clean \
150+
&& cd / \
151+
&& docker-php-source delete \
152+
\
153+
&& runDeps="$( \
154+
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
155+
| tr ',' '\n' \
156+
| sort -u \
157+
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
158+
)" \
159+
&& apk add --no-cache --virtual .php-rundeps $runDeps \
160+
\
161+
&& apk del .build-deps \
162+
\
163+
# https://github.com/docker-library/php/issues/443
164+
&& pecl update-channels \
165+
&& rm -rf /tmp/pear ~/.pearrc
166+
167+
COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
168+
169+
# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598)
170+
RUN docker-php-ext-enable sodium
171+
172+
ENTRYPOINT ["docker-php-entrypoint"]
173+
##<autogenerated>##
174+
CMD ["php", "-a"]
175+
##</autogenerated>##
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
set -e
3+
4+
# first arg is `-f` or `--some-option`
5+
if [ "${1#-}" != "$1" ]; then
6+
set -- php "$@"
7+
fi
8+
9+
exec "$@"
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#!/bin/sh
2+
set -e
3+
4+
# prefer user supplied CFLAGS, but default to our PHP_CFLAGS
5+
: ${CFLAGS:=$PHP_CFLAGS}
6+
: ${CPPFLAGS:=$PHP_CPPFLAGS}
7+
: ${LDFLAGS:=$PHP_LDFLAGS}
8+
export CFLAGS CPPFLAGS LDFLAGS
9+
10+
srcExists=
11+
if [ -d /usr/src/php ]; then
12+
srcExists=1
13+
fi
14+
docker-php-source extract
15+
if [ -z "$srcExists" ]; then
16+
touch /usr/src/php/.docker-delete-me
17+
fi
18+
19+
cd /usr/src/php/ext
20+
21+
usage() {
22+
echo "usage: $0 ext-name [configure flags]"
23+
echo " ie: $0 gd --with-jpeg-dir=/usr/local/something"
24+
echo
25+
echo 'Possible values for ext-name:'
26+
find . \
27+
-mindepth 2 \
28+
-maxdepth 2 \
29+
-type f \
30+
-name 'config.m4' \
31+
| xargs -n1 dirname \
32+
| xargs -n1 basename \
33+
| sort \
34+
| xargs
35+
echo
36+
echo 'Some of the above modules are already compiled into PHP; please check'
37+
echo 'the output of "php -i" to see which modules are already loaded.'
38+
}
39+
40+
ext="$1"
41+
if [ -z "$ext" ] || [ ! -d "$ext" ]; then
42+
usage >&2
43+
exit 1
44+
fi
45+
shift
46+
47+
pm='unknown'
48+
if [ -e /lib/apk/db/installed ]; then
49+
pm='apk'
50+
fi
51+
52+
if [ "$pm" = 'apk' ]; then
53+
if \
54+
[ -n "$PHPIZE_DEPS" ] \
55+
&& ! apk info --installed .phpize-deps > /dev/null \
56+
&& ! apk info --installed .phpize-deps-configure > /dev/null \
57+
; then
58+
apk add --no-cache --virtual .phpize-deps-configure $PHPIZE_DEPS
59+
fi
60+
fi
61+
62+
if command -v dpkg-architecture > /dev/null; then
63+
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"
64+
set -- --build="$gnuArch" "$@"
65+
fi
66+
67+
cd "$ext"
68+
phpize
69+
./configure "$@"

0 commit comments

Comments
 (0)