Skip to content

Commit b1db0fb

Browse files
committed
update
1 parent 9cc5dfc commit b1db0fb

File tree

6 files changed

+370
-352
lines changed

6 files changed

+370
-352
lines changed

7.0/Dockerfile

Lines changed: 59 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM alpine:3.14
1+
FROM alpine:3.13
22
LABEL maintainer="Shion <shion.chow@gmail.com>"
33

44
ENV PHP_VERSION 7.0.33
@@ -7,47 +7,51 @@ ENV PHP_REDIS_VERSION 5.3.4
77
ENV PHP_MONGODB_VERSION 1.9.2
88

99
ENV BUILD_TOOLS \
10-
curl \
11-
gcc \
12-
libc-dev \
13-
make \
14-
autoconf
10+
curl \
11+
autoconf \
12+
make \
13+
gcc \
14+
libc-dev
1515

1616
ENV BUILD_DEPS \
17-
libxml2-dev \
18-
curl-dev \
19-
bzip2-dev \
20-
libwebp-dev \
21-
libjpeg-turbo-dev \
22-
libpng-dev freetype-dev \
23-
libmcrypt-dev \
24-
postgresql-dev \
25-
libedit-dev \
26-
libmemcached-dev
17+
libxml2-dev \
18+
curl-dev gd-dev \
19+
gettext-dev \
20+
gmp-dev \
21+
libmcrypt-dev \
22+
postgresql-dev \
23+
libedit-dev \
24+
libzip-dev \
25+
libxpm-dev \
26+
libmemcached-dev
2727

2828
ENV RUNTIME_DEPS \
29-
libedit \
30-
libpq \
31-
libmcrypt \
32-
libpng \
33-
libjpeg-turbo \
34-
libwebp \
35-
libcurl \
36-
libbz2 \
37-
libxml2 \
38-
freetype \
39-
libmemcached \
40-
icu-libs
29+
libpq \
30+
gmp \
31+
libmcrypt \
32+
gettext-libs \
33+
libxml2 \
34+
libcurl \
35+
libpng \
36+
libwebp \
37+
libjpeg-turbo \
38+
libxpm \
39+
freetype \
40+
libedit \
41+
libzip \
42+
libmemcached \
43+
icu-libs
4144

4245
ENV PHP_INI_DIR /usr/local/etc/php
4346

44-
RUN adduser -u 82 -D -S -G www-data www-data
47+
# 82 is the standard uid/gid for "www-data" in Alpine
48+
RUN addgroup -g 82 -S www-data && adduser -u 82 -D -H -S -G www-data www-data
4549

4650
# https://github.com/docker-library/php/issues/272
4751
RUN export CFLAGS="-fstack-protector-strong -fpic -fpie -O2" \
48-
&& export CPPFLAGS=${CFLAGS} \
49-
&& export LDFLAGS="-Wl,-O1 -Wl,--hash-style=both -pie" \
50-
&& export MAKEFLAGS="-j $(getconf _NPROCESSORS_ONLN)"
52+
&& export CPPFLAGS=${CFLAGS} \
53+
&& export LDFLAGS="-Wl,-O1 -Wl,--hash-style=both -pie" \
54+
&& export MAKEFLAGS="-j $(getconf _NPROCESSORS_ONLN)"
5155

5256
RUN apk add --no-cache --virtual .build-tools $BUILD_TOOLS \
5357
&& apk add --no-cache --virtual .build-deps $BUILD_DEPS \
@@ -61,36 +65,35 @@ RUN apk add --no-cache --virtual .build-tools $BUILD_TOOLS \
6165
&& ./configure \
6266
--with-config-file-path="$PHP_INI_DIR" \
6367
--with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
64-
--disable-cgi \
6568
--enable-fpm \
66-
--with-fpm-user=www-data \
67-
--with-fpm-group=www-data \
68-
--enable-mbstring \
69-
--enable-bcmath \
70-
--enable-zip \
71-
--enable-exif \
72-
--enable-mysqlnd \
73-
--enable-pcntl \
74-
--enable-shmop \
75-
--with-gd \
76-
--with-webp-dir=/usr/lib \
77-
--with-jpeg-dir=/usr/lib \
78-
--with-png-dir=/usr/lib \
79-
--with-zlib-dir=/usr/lib \
80-
--with-freetype-dir=/usr/lib \
81-
--enable-gd-native-ttf \
69+
--with-fpm-user=www-data \
70+
--with-fpm-group=www-data \
71+
--disable-cgi \
72+
--disable-short-tags \
73+
--with-openssl \
74+
--with-pcre-jit \
8275
--with-zlib \
83-
--with-bz2 \
76+
--enable-bcmath \
8477
--with-curl \
78+
--with-gd \
79+
--with-webp-dir \
80+
--with-jpeg-dir \
81+
--with-png-dir \
82+
--with-xpm-dir \
83+
--with-freetype-dir \
84+
--enable-gd-native-ttf \
85+
--with-gettext \
86+
--with-gmp \
87+
--enable-mbstring \
8588
--with-mcrypt \
86-
--with-mhash \
87-
--with-openssl \
88-
--with-pgsql \
89-
--with-mysqli \
90-
--with-pdo-mysql=mysqlnd \
89+
--with-pdo-mysql \
9190
--with-pdo-pgsql \
9291
--with-libedit \
93-
&& make && make install \
92+
--enable-zip \
93+
--with-libzip \
94+
--enable-mysqlnd \
95+
&& make \
96+
&& make install \
9497
# config
9598
&& cp /usr/local/etc/php-fpm.conf.default /usr/local/etc/php-fpm.conf \
9699
&& cp /usr/local/etc/php-fpm.d/www.conf.default /usr/local/etc/php-fpm.d/www.conf \

7.1/Dockerfile

Lines changed: 59 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM alpine:3.14
1+
FROM alpine:3.13
22
LABEL maintainer="Shion <shion.chow@gmail.com>"
33

44
ENV PHP_VERSION 7.1.33
@@ -7,47 +7,51 @@ ENV PHP_REDIS_VERSION 5.3.4
77
ENV PHP_MONGODB_VERSION 1.10.0
88

99
ENV BUILD_TOOLS \
10-
curl \
11-
gcc \
12-
libc-dev \
13-
make \
14-
autoconf
10+
curl \
11+
autoconf \
12+
make \
13+
gcc \
14+
libc-dev
1515

1616
ENV BUILD_DEPS \
17-
libxml2-dev \
18-
curl-dev \
19-
bzip2-dev \
20-
libwebp-dev \
21-
libjpeg-turbo-dev \
22-
libpng-dev freetype-dev \
23-
libmcrypt-dev \
24-
postgresql-dev \
25-
libedit-dev \
26-
libmemcached-dev
17+
libxml2-dev \
18+
curl-dev gd-dev \
19+
gettext-dev \
20+
gmp-dev \
21+
libmcrypt-dev \
22+
postgresql-dev \
23+
libedit-dev \
24+
libzip-dev \
25+
libxpm-dev \
26+
libmemcached-dev
2727

2828
ENV RUNTIME_DEPS \
29-
libedit \
30-
libpq \
31-
libmcrypt \
32-
libpng \
33-
libjpeg-turbo \
34-
libwebp \
35-
libcurl \
36-
libbz2 \
37-
libxml2 \
38-
freetype \
39-
libmemcached \
40-
icu-libs
29+
libpq \
30+
gmp \
31+
libmcrypt \
32+
gettext-libs \
33+
libxml2 \
34+
libcurl \
35+
libpng \
36+
libwebp \
37+
libjpeg-turbo \
38+
libxpm \
39+
freetype \
40+
libedit \
41+
libzip \
42+
libmemcached \
43+
icu-libs
4144

4245
ENV PHP_INI_DIR /usr/local/etc/php
4346

44-
RUN adduser -u 82 -D -S -G www-data www-data
47+
# 82 is the standard uid/gid for "www-data" in Alpine
48+
RUN addgroup -g 82 -S www-data && adduser -u 82 -D -H -S -G www-data www-data
4549

4650
# https://github.com/docker-library/php/issues/272
4751
RUN export CFLAGS="-fstack-protector-strong -fpic -fpie -O2" \
48-
&& export CPPFLAGS=${CFLAGS} \
49-
&& export LDFLAGS="-Wl,-O1 -Wl,--hash-style=both -pie" \
50-
&& export MAKEFLAGS="-j $(getconf _NPROCESSORS_ONLN)"
52+
&& export CPPFLAGS=${CFLAGS} \
53+
&& export LDFLAGS="-Wl,-O1 -Wl,--hash-style=both -pie" \
54+
&& export MAKEFLAGS="-j $(getconf _NPROCESSORS_ONLN)"
5155

5256
RUN apk add --no-cache --virtual .build-tools $BUILD_TOOLS \
5357
&& apk add --no-cache --virtual .build-deps $BUILD_DEPS \
@@ -61,36 +65,35 @@ RUN apk add --no-cache --virtual .build-tools $BUILD_TOOLS \
6165
&& ./configure \
6266
--with-config-file-path="$PHP_INI_DIR" \
6367
--with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
64-
--disable-cgi \
6568
--enable-fpm \
66-
--with-fpm-user=www-data \
67-
--with-fpm-group=www-data \
68-
--enable-mbstring \
69-
--enable-bcmath \
70-
--enable-zip \
71-
--enable-exif \
72-
--enable-mysqlnd \
73-
--enable-pcntl \
74-
--enable-shmop \
75-
--with-gd \
76-
--with-webp-dir=/usr/lib \
77-
--with-jpeg-dir=/usr/lib \
78-
--with-png-dir=/usr/lib \
79-
--with-zlib-dir=/usr/lib \
80-
--with-freetype-dir=/usr/lib \
81-
--enable-gd-native-ttf \
69+
--with-fpm-user=www-data \
70+
--with-fpm-group=www-data \
71+
--disable-cgi \
72+
--disable-short-tags \
73+
--with-openssl \
74+
--with-pcre-jit \
8275
--with-zlib \
83-
--with-bz2 \
76+
--enable-bcmath \
8477
--with-curl \
78+
--with-gd \
79+
--with-webp-dir \
80+
--with-jpeg-dir \
81+
--with-png-dir \
82+
--with-xpm-dir \
83+
--with-freetype-dir \
84+
--enable-gd-native-ttf \
85+
--with-gettext \
86+
--with-gmp \
87+
--enable-mbstring \
8588
--with-mcrypt \
86-
--with-mhash \
87-
--with-openssl \
88-
--with-pgsql \
89-
--with-mysqli \
90-
--with-pdo-mysql=mysqlnd \
89+
--with-pdo-mysql \
9190
--with-pdo-pgsql \
9291
--with-libedit \
93-
&& make && make install \
92+
--enable-zip \
93+
--with-libzip \
94+
--enable-mysqlnd \
95+
&& make \
96+
&& make install \
9497
# config
9598
&& cp /usr/local/etc/php-fpm.conf.default /usr/local/etc/php-fpm.conf \
9699
&& cp /usr/local/etc/php-fpm.d/www.conf.default /usr/local/etc/php-fpm.d/www.conf \

0 commit comments

Comments
 (0)