Skip to content

Commit 72f2e43

Browse files
authored
Merge pull request #646 from infosiftr/in-your-base
Add stretch and alpine 3.7 variants for 5.6, 7.0 and 7.1.
2 parents e3bc10f + 78125d0 commit 72f2e43

File tree

131 files changed

+11698
-0
lines changed

Some content is hidden

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

131 files changed

+11698
-0
lines changed

.travis.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,45 @@ env:
1212
- VERSION=7.2 VARIANT=alpine3.6/cli
1313
- VERSION=7.2 VARIANT=alpine3.6/fpm
1414
- VERSION=7.2 VARIANT=alpine3.6/zts
15+
- VERSION=7.1 VARIANT=stretch/cli
16+
- VERSION=7.1 VARIANT=stretch/apache
17+
- VERSION=7.1 VARIANT=stretch/fpm
18+
- VERSION=7.1 VARIANT=stretch/zts
1519
- VERSION=7.1 VARIANT=jessie/cli
1620
- VERSION=7.1 VARIANT=jessie/apache
1721
- VERSION=7.1 VARIANT=jessie/fpm
1822
- VERSION=7.1 VARIANT=jessie/zts
23+
- VERSION=7.1 VARIANT=alpine3.7/cli
24+
- VERSION=7.1 VARIANT=alpine3.7/fpm
25+
- VERSION=7.1 VARIANT=alpine3.7/zts
1926
- VERSION=7.1 VARIANT=alpine3.4/cli
2027
- VERSION=7.1 VARIANT=alpine3.4/fpm
2128
- VERSION=7.1 VARIANT=alpine3.4/zts
29+
- VERSION=7.0 VARIANT=stretch/cli
30+
- VERSION=7.0 VARIANT=stretch/apache
31+
- VERSION=7.0 VARIANT=stretch/fpm
32+
- VERSION=7.0 VARIANT=stretch/zts
2233
- VERSION=7.0 VARIANT=jessie/cli
2334
- VERSION=7.0 VARIANT=jessie/apache
2435
- VERSION=7.0 VARIANT=jessie/fpm
2536
- VERSION=7.0 VARIANT=jessie/zts
37+
- VERSION=7.0 VARIANT=alpine3.7/cli
38+
- VERSION=7.0 VARIANT=alpine3.7/fpm
39+
- VERSION=7.0 VARIANT=alpine3.7/zts
2640
- VERSION=7.0 VARIANT=alpine3.4/cli
2741
- VERSION=7.0 VARIANT=alpine3.4/fpm
2842
- VERSION=7.0 VARIANT=alpine3.4/zts
43+
- VERSION=5.6 VARIANT=stretch/cli
44+
- VERSION=5.6 VARIANT=stretch/apache
45+
- VERSION=5.6 VARIANT=stretch/fpm
46+
- VERSION=5.6 VARIANT=stretch/zts
2947
- VERSION=5.6 VARIANT=jessie/cli
3048
- VERSION=5.6 VARIANT=jessie/apache
3149
- VERSION=5.6 VARIANT=jessie/fpm
3250
- VERSION=5.6 VARIANT=jessie/zts
51+
- VERSION=5.6 VARIANT=alpine3.7/cli
52+
- VERSION=5.6 VARIANT=alpine3.7/fpm
53+
- VERSION=5.6 VARIANT=alpine3.7/zts
3354
- VERSION=5.6 VARIANT=alpine3.4/cli
3455
- VERSION=5.6 VARIANT=alpine3.4/fpm
3556
- VERSION=5.6 VARIANT=alpine3.4/zts

5.6/alpine3.7/cli/Dockerfile

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
#
2+
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
3+
#
4+
# PLEASE DO NOT EDIT IT DIRECTLY.
5+
#
6+
7+
FROM alpine:3.7
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 0BD78B5F97500D450838F95DFE857D9A90D90EC1 6E4F6AB321FDC07F2C332E3AC2BF0BC433CFC8B3
57+
58+
ENV PHP_VERSION 5.6.36
59+
ENV PHP_URL="https://secure.php.net/get/php-5.6.36.tar.xz/from/this/mirror" PHP_ASC_URL="https://secure.php.net/get/php-5.6.36.tar.xz.asc/from/this/mirror"
60+
ENV PHP_SHA256="18f536bf548e909b4e980379d0c4e56d024b2b1eb1c9768fd169360491f1d6dd" PHP_MD5=""
61+
62+
RUN set -xe; \
63+
\
64+
apk add --no-cache --virtual .fetch-deps \
65+
gnupg \
66+
; \
67+
\
68+
mkdir -p /usr/src; \
69+
cd /usr/src; \
70+
\
71+
wget -O php.tar.xz "$PHP_URL"; \
72+
\
73+
if [ -n "$PHP_SHA256" ]; then \
74+
echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \
75+
fi; \
76+
if [ -n "$PHP_MD5" ]; then \
77+
echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; \
78+
fi; \
79+
\
80+
if [ -n "$PHP_ASC_URL" ]; then \
81+
wget -O php.tar.xz.asc "$PHP_ASC_URL"; \
82+
export GNUPGHOME="$(mktemp -d)"; \
83+
for key in $GPG_KEYS; do \
84+
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \
85+
done; \
86+
gpg --batch --verify php.tar.xz.asc php.tar.xz; \
87+
rm -rf "$GNUPGHOME"; \
88+
fi; \
89+
\
90+
apk del .fetch-deps
91+
92+
COPY docker-php-source /usr/local/bin/
93+
94+
RUN set -xe \
95+
&& apk add --no-cache --virtual .build-deps \
96+
$PHPIZE_DEPS \
97+
coreutils \
98+
curl-dev \
99+
libedit-dev \
100+
libressl-dev \
101+
libxml2-dev \
102+
sqlite-dev \
103+
\
104+
&& export CFLAGS="$PHP_CFLAGS" \
105+
CPPFLAGS="$PHP_CPPFLAGS" \
106+
LDFLAGS="$PHP_LDFLAGS" \
107+
&& docker-php-source extract \
108+
&& cd /usr/src/php \
109+
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
110+
&& ./configure \
111+
--build="$gnuArch" \
112+
--with-config-file-path="$PHP_INI_DIR" \
113+
--with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
114+
\
115+
# make sure invalid --configure-flags are fatal errors intead of just warnings
116+
--enable-option-checking=fatal \
117+
\
118+
--disable-cgi \
119+
\
120+
# https://github.com/docker-library/php/issues/439
121+
--with-mhash \
122+
\
123+
# --enable-ftp is included here because ftp_ssl_connect() needs ftp to be compiled statically (see https://github.com/docker-library/php/issues/236)
124+
--enable-ftp \
125+
# --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)
126+
--enable-mbstring \
127+
# --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)
128+
--enable-mysqlnd \
129+
\
130+
--with-curl \
131+
--with-libedit \
132+
--with-openssl \
133+
--with-zlib \
134+
\
135+
# bundled pcre does not support JIT on s390x
136+
# https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT
137+
$(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \
138+
\
139+
$PHP_EXTRA_CONFIGURE_ARGS \
140+
&& make -j "$(nproc)" \
141+
&& make install \
142+
&& { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \
143+
&& make clean \
144+
&& cd / \
145+
&& docker-php-source delete \
146+
\
147+
&& runDeps="$( \
148+
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
149+
| tr ',' '\n' \
150+
| sort -u \
151+
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
152+
)" \
153+
&& apk add --no-cache --virtual .php-rundeps $runDeps \
154+
\
155+
&& apk del .build-deps \
156+
\
157+
# https://github.com/docker-library/php/issues/443
158+
&& pecl update-channels \
159+
&& rm -rf /tmp/pear ~/.pearrc
160+
161+
COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
162+
163+
ENTRYPOINT ["docker-php-entrypoint"]
164+
##<autogenerated>##
165+
CMD ["php", "-a"]
166+
##</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)