Skip to content

Commit a414802

Browse files
committed
Add 8.0.0alpha1
1 parent 2a6aa0f commit a414802

Some content is hidden

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

47 files changed

+4138
-3
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=8.0-rc VARIANT=buster/cli
6+
- VERSION=8.0-rc VARIANT=buster/apache
7+
- VERSION=8.0-rc VARIANT=buster/fpm
8+
- VERSION=8.0-rc VARIANT=buster/zts
9+
- VERSION=8.0-rc VARIANT=alpine3.12/cli
10+
- VERSION=8.0-rc VARIANT=alpine3.12/fpm
11+
- VERSION=8.0-rc VARIANT=alpine3.12/zts
512
- VERSION=7.4 VARIANT=buster/cli
613
- VERSION=7.4 VARIANT=buster/apache
714
- VERSION=7.4 VARIANT=buster/fpm

8.0-rc/alpine3.12/cli/Dockerfile

Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
#
2+
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
3+
#
4+
# PLEASE DO NOT EDIT IT DIRECTLY.
5+
#
6+
7+
FROM alpine:3.12
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 \
24+
ca-certificates \
25+
curl \
26+
tar \
27+
xz \
28+
# https://github.com/docker-library/php/issues/494
29+
openssl
30+
31+
# ensure www-data user exists
32+
RUN set -eux; \
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+
# https://git.alpinelinux.org/aports/tree/main/apache2/apache2.pre-install?h=3.9-stable
37+
# https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.9-stable
38+
# https://git.alpinelinux.org/aports/tree/main/nginx/nginx.pre-install?h=3.9-stable
39+
40+
ENV PHP_INI_DIR /usr/local/etc/php
41+
RUN set -eux; \
42+
mkdir -p "$PHP_INI_DIR/conf.d"; \
43+
# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743)
44+
[ ! -d /var/www/html ]; \
45+
mkdir -p /var/www/html; \
46+
chown www-data:www-data /var/www/html; \
47+
chmod 777 /var/www/html
48+
49+
##<autogenerated>##
50+
##</autogenerated>##
51+
52+
# Apply stack smash protection to functions using local buffers and alloca()
53+
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
54+
# Enable optimization (-O2)
55+
# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default)
56+
# https://github.com/docker-library/php/issues/272
57+
# -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64 (https://www.php.net/manual/en/intro.filesystem.php)
58+
ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
59+
ENV PHP_CPPFLAGS="$PHP_CFLAGS"
60+
ENV PHP_LDFLAGS="-Wl,-O1 -pie"
61+
62+
ENV GPG_KEYS 1729F83938DA44E27BA0F4D3DBDB397470D12172 BFDDD28642824F8118EF77909B67A5C12229118F
63+
64+
ENV PHP_VERSION 8.0.0alpha1
65+
ENV PHP_URL="https://downloads.php.net/~pollita/php-8.0.0alpha1.tar.xz" PHP_ASC_URL="https://downloads.php.net/~pollita/php-8.0.0alpha1.tar.xz.asc"
66+
ENV PHP_SHA256="2ab527b3b96908b123271ee390ea01169effeb5027a7f85dbe4d0d37d7da1628" PHP_MD5=""
67+
68+
RUN set -eux; \
69+
\
70+
apk add --no-cache --virtual .fetch-deps gnupg; \
71+
\
72+
mkdir -p /usr/src; \
73+
cd /usr/src; \
74+
\
75+
curl -fsSL -o php.tar.xz "$PHP_URL"; \
76+
\
77+
if [ -n "$PHP_SHA256" ]; then \
78+
echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \
79+
fi; \
80+
if [ -n "$PHP_MD5" ]; then \
81+
echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; \
82+
fi; \
83+
\
84+
if [ -n "$PHP_ASC_URL" ]; then \
85+
curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \
86+
export GNUPGHOME="$(mktemp -d)"; \
87+
for key in $GPG_KEYS; do \
88+
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \
89+
done; \
90+
gpg --batch --verify php.tar.xz.asc php.tar.xz; \
91+
gpgconf --kill all; \
92+
rm -rf "$GNUPGHOME"; \
93+
fi; \
94+
\
95+
apk del --no-network .fetch-deps
96+
97+
COPY docker-php-source /usr/local/bin/
98+
99+
RUN set -eux; \
100+
apk add --no-cache --virtual .build-deps \
101+
$PHPIZE_DEPS \
102+
argon2-dev \
103+
coreutils \
104+
curl-dev \
105+
libedit-dev \
106+
libsodium-dev \
107+
libxml2-dev \
108+
linux-headers \
109+
oniguruma-dev \
110+
openssl-dev \
111+
sqlite-dev \
112+
; \
113+
\
114+
export CFLAGS="$PHP_CFLAGS" \
115+
CPPFLAGS="$PHP_CPPFLAGS" \
116+
LDFLAGS="$PHP_LDFLAGS" \
117+
; \
118+
docker-php-source extract; \
119+
cd /usr/src/php; \
120+
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \
121+
./configure \
122+
--build="$gnuArch" \
123+
--with-config-file-path="$PHP_INI_DIR" \
124+
--with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
125+
\
126+
# make sure invalid --configure-flags are fatal errors instead of just warnings
127+
--enable-option-checking=fatal \
128+
\
129+
# https://github.com/docker-library/php/issues/439
130+
--with-mhash \
131+
\
132+
# --enable-ftp is included here because ftp_ssl_connect() needs ftp to be compiled statically (see https://github.com/docker-library/php/issues/236)
133+
--enable-ftp \
134+
# --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)
135+
--enable-mbstring \
136+
# --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)
137+
--enable-mysqlnd \
138+
# https://wiki.php.net/rfc/argon2_password_hash (7.2+)
139+
--with-password-argon2 \
140+
# https://wiki.php.net/rfc/libsodium
141+
--with-sodium=shared \
142+
# always build against system sqlite3 (https://github.com/php/php-src/commit/6083a387a81dbbd66d6316a3a12a63f06d5f7109)
143+
--with-pdo-sqlite=/usr \
144+
--with-sqlite3=/usr \
145+
\
146+
--with-curl \
147+
--with-libedit \
148+
--with-openssl \
149+
--with-zlib \
150+
\
151+
# bundled pcre does not support JIT on s390x
152+
# https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT
153+
$(test "$gnuArch" = 's390x-linux-musl' && echo '--without-pcre-jit') \
154+
\
155+
${PHP_EXTRA_CONFIGURE_ARGS:-} \
156+
; \
157+
make -j "$(nproc)"; \
158+
find -type f -name '*.a' -delete; \
159+
make install; \
160+
find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; \
161+
make clean; \
162+
\
163+
# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable)
164+
cp -v php.ini-* "$PHP_INI_DIR/"; \
165+
\
166+
cd /; \
167+
docker-php-source delete; \
168+
\
169+
runDeps="$( \
170+
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
171+
| tr ',' '\n' \
172+
| sort -u \
173+
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
174+
)"; \
175+
apk add --no-cache $runDeps; \
176+
\
177+
apk del --no-network .build-deps; \
178+
\
179+
# smoke test
180+
php --version
181+
182+
COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
183+
184+
# 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)
185+
RUN docker-php-ext-enable sodium
186+
187+
ENTRYPOINT ["docker-php-entrypoint"]
188+
##<autogenerated>##
189+
CMD ["php", "-a"]
190+
##</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 --enable-option-checking=fatal "$@"

0 commit comments

Comments
 (0)