Skip to content

Commit e0c6bb2

Browse files
Fixes
1 parent 3412d10 commit e0c6bb2

File tree

10 files changed

+52
-9
lines changed

10 files changed

+52
-9
lines changed

layers/fpm-dev/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ ARG PHP_VERSION
1010
RUN mkdir -p /opt/bref/extensions
1111

1212
# Install xdebug
13-
RUN pecl install xdebug-3.4.5
14-
RUN cp $(php -r "echo ini_get('extension_dir');")/xdebug.so /opt/bref/extensions
13+
RUN if [ $PHP_VERSION != "85" ]; then pecl install xdebug-3.4.5; fi
14+
RUN if [ $PHP_VERSION != "85" ]; then cp $(php -r "echo ini_get('extension_dir');")/xdebug.so /opt/bref/extensions; fi
1515

1616
# Install Blackfire
1717
# https://blackfire.io/docs/up-and-running/installation?action=install&mode=full&version=latest&mode=full&location=server&os=manual&language=php#install-the-php-probe

layers/fpm/bref.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,3 @@ upload_max_filesize=6M
4747
extension_dir=/opt/bref/extensions
4848
; Extensions enabled by default
4949
extension=pdo_mysql.so
50-
zend_extension=opcache.so

layers/function/bref.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,3 @@ variables_order="EGPCS"
4141
extension_dir=/opt/bref/extensions
4242
; Extensions enabled by default
4343
extension=pdo_mysql.so
44-
zend_extension=opcache.so

layers/opcache.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
zend_extension=opcache.so

php-80/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,7 @@ COPY --link layers/bootstrap.php /opt/bref/bootstrap.php
514514
FROM isolation as function
515515

516516
COPY --link layers/function/bref.ini /opt/bref/etc/php/conf.d/
517+
COPY --link layers/opcache.ini /opt/bref/etc/php/conf.d/
517518

518519
COPY --link layers/function/bootstrap.sh /opt/bootstrap
519520
# Copy files to /var/runtime to support deploying as a Docker image
@@ -537,6 +538,7 @@ FROM isolation as fpm
537538
COPY --link --from=fpm-extension /bref-layer /opt
538539

539540
COPY --link layers/fpm/bref.ini /opt/bref/etc/php/conf.d/
541+
COPY --link layers/opcache.ini /opt/bref/etc/php/conf.d/
540542

541543
COPY --link layers/fpm/bootstrap.sh /opt/bootstrap
542544
# Copy files to /var/runtime to support deploying as a Docker image

php-81/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,7 @@ COPY --link layers/bootstrap.php /opt/bref/bootstrap.php
536536
FROM isolation as function
537537

538538
COPY --link layers/function/bref.ini /opt/bref/etc/php/conf.d/
539+
COPY --link layers/opcache.ini /opt/bref/etc/php/conf.d/
539540

540541
COPY --link layers/function/bootstrap.sh /opt/bootstrap
541542
# Copy files to /var/runtime to support deploying as a Docker image
@@ -559,6 +560,7 @@ FROM isolation as fpm
559560
COPY --link --from=fpm-extension /bref-layer /opt
560561

561562
COPY --link layers/fpm/bref.ini /opt/bref/etc/php/conf.d/
563+
COPY --link layers/opcache.ini /opt/bref/etc/php/conf.d/
562564

563565
COPY --link layers/fpm/bootstrap.sh /opt/bootstrap
564566
# Copy files to /var/runtime to support deploying as a Docker image

php-82/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,7 @@ COPY --link layers/bootstrap.php /opt/bref/bootstrap.php
536536
FROM isolation as function
537537

538538
COPY --link layers/function/bref.ini /opt/bref/etc/php/conf.d/
539+
COPY --link layers/opcache.ini /opt/bref/etc/php/conf.d/
539540

540541
COPY --link layers/function/bootstrap.sh /opt/bootstrap
541542
# Copy files to /var/runtime to support deploying as a Docker image
@@ -559,6 +560,7 @@ FROM isolation as fpm
559560
COPY --link --from=fpm-extension /bref-layer /opt
560561

561562
COPY --link layers/fpm/bref.ini /opt/bref/etc/php/conf.d/
563+
COPY --link layers/opcache.ini /opt/bref/etc/php/conf.d/
562564

563565
COPY --link layers/fpm/bootstrap.sh /opt/bootstrap
564566
# Copy files to /var/runtime to support deploying as a Docker image

php-83/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,7 @@ COPY --link layers/bootstrap.php /opt/bref/bootstrap.php
536536
FROM isolation as function
537537

538538
COPY --link layers/function/bref.ini /opt/bref/etc/php/conf.d/
539+
COPY --link layers/opcache.ini /opt/bref/etc/php/conf.d/
539540

540541
COPY --link layers/function/bootstrap.sh /opt/bootstrap
541542
# Copy files to /var/runtime to support deploying as a Docker image
@@ -559,6 +560,7 @@ FROM isolation as fpm
559560
COPY --link --from=fpm-extension /bref-layer /opt
560561

561562
COPY --link layers/fpm/bref.ini /opt/bref/etc/php/conf.d/
563+
COPY --link layers/opcache.ini /opt/bref/etc/php/conf.d/
562564

563565
COPY --link layers/fpm/bootstrap.sh /opt/bootstrap
564566
# Copy files to /var/runtime to support deploying as a Docker image

php-84/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,7 @@ COPY --link layers/bootstrap.php /opt/bref/bootstrap.php
537537
FROM isolation as function
538538

539539
COPY --link layers/function/bref.ini /opt/bref/etc/php/conf.d/
540+
COPY --link layers/opcache.ini /opt/bref/etc/php/conf.d/
540541

541542
COPY --link layers/function/bootstrap.sh /opt/bootstrap
542543
# Copy files to /var/runtime to support deploying as a Docker image
@@ -560,6 +561,7 @@ FROM isolation as fpm
560561
COPY --link --from=fpm-extension /bref-layer /opt
561562

562563
COPY --link layers/fpm/bref.ini /opt/bref/etc/php/conf.d/
564+
COPY --link layers/opcache.ini /opt/bref/etc/php/conf.d/
563565

564566
COPY --link layers/fpm/bootstrap.sh /opt/bootstrap
565567
# Copy files to /var/runtime to support deploying as a Docker image

php-85/Dockerfile

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
ARG IMAGE_VERSION_SUFFIX
55

66
# https://www.php.net/downloads
7-
ARG VERSION_PHP=8.5.0alpha4
7+
ARG VERSION_PHP=8.5.0beta1
88

99

1010
# Lambda uses a custom AMI named Amazon Linux 2
@@ -133,10 +133,42 @@ RUN make -j1 install_sw install_ssldirs
133133
RUN mkdir -p ${INSTALL_DIR}/bref/ssl && curl -Lk -o ${CA_BUNDLE} ${CA_BUNDLE_SOURCE}
134134

135135

136+
###############################################################################
137+
# ICU
138+
# We need to compile ICU from source because Amazon Linux 2 only has ICU 50.2
139+
# but PHP 8.5 requires ICU 57.1 or higher
140+
# https://github.com/unicode-org/icu/releases
141+
# Uses:
142+
# - None
143+
# Needed by:
144+
# - libxml2
145+
# - php intl extension
146+
ENV VERSION_ICU=77.1
147+
ENV ICU_BUILD_DIR=${BUILD_DIR}/icu
148+
RUN set -xe; \
149+
mkdir -p ${ICU_BUILD_DIR}; \
150+
curl -Ls https://github.com/unicode-org/icu/releases/download/release-${VERSION_ICU//./-}/icu4c-${VERSION_ICU//./_}-src.tgz \
151+
| tar xzC ${ICU_BUILD_DIR} --strip-components=1
152+
WORKDIR ${ICU_BUILD_DIR}/source
153+
RUN CFLAGS="" \
154+
CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \
155+
LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib -Wl,-rpath,${INSTALL_DIR}/lib" \
156+
./configure \
157+
--prefix=${INSTALL_DIR} \
158+
--enable-shared \
159+
--disable-static \
160+
--disable-samples \
161+
--disable-tests \
162+
--disable-extras \
163+
--disable-layoutex
164+
RUN make && make install
165+
166+
136167
###############################################################################
137168
# LIBXML2
138169
# https://gitlab.gnome.org/GNOME/libxml2/-/releases
139170
# Uses:
171+
# - icu
140172
# - zlib
141173
# Needed by:
142174
# - php
@@ -151,6 +183,9 @@ WORKDIR ${XML2_BUILD_DIR}/
151183
RUN CFLAGS="" \
152184
CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \
153185
LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \
186+
PATH="${INSTALL_DIR}/bin:${PATH}" \
187+
ICU_CFLAGS="-I${INSTALL_DIR}/include" \
188+
ICU_LIBS="-L${INSTALL_DIR}/lib -licui18n -licuuc -licudata" \
154189
./configure \
155190
--prefix=${INSTALL_DIR} \
156191
--with-sysroot=${INSTALL_DIR} \
@@ -402,10 +437,9 @@ RUN make && make install
402437
# Install some dev files for using old libraries already on the system
403438
# readline-devel : needed for the readline extension
404439
# gettext-devel : needed for the --with-gettext flag
405-
# libicu-devel : needed for intl
406440
# libxslt-devel : needed for the XSL extension
407441
# libffi-devel : needed for the FFI extension
408-
RUN LD_LIBRARY_PATH= yum install -y readline-devel gettext-devel libicu-devel libxslt-devel libffi-devel
442+
RUN LD_LIBRARY_PATH= yum install -y readline-devel gettext-devel libxslt-devel libffi-devel
409443

410444

411445
# Note: this variable is used when building extra/custom extensions, do not remove
@@ -427,7 +461,7 @@ WORKDIR ${PHP_BUILD_DIR}
427461
# --silent will hide the progress, but also the errors: we restore error messages with --show-error
428462
# --fail makes sure that curl returns an error instead of fetching the 404 page
429463
ARG VERSION_PHP
430-
RUN curl --location --silent --show-error --fail https://downloads.php.net/~daniels/php-${VERSION_PHP}.tar.gz \
464+
RUN curl --location --silent --show-error --fail https://downloads.php.net/~edorian/php-${VERSION_PHP}.tar.gz \
431465
| tar xzC . --strip-components=1
432466

433467
# Configure the build
@@ -444,6 +478,7 @@ RUN ./buildconf --force
444478
RUN CFLAGS="-fstack-protector-strong -fpic -fpie -O3 -I${INSTALL_DIR}/include -I/usr/include -ffunction-sections -fdata-sections" \
445479
CPPFLAGS="-fstack-protector-strong -fpic -fpie -O3 -I${INSTALL_DIR}/include -I/usr/include -ffunction-sections -fdata-sections" \
446480
LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib -Wl,-O1 -Wl,--strip-all -Wl,--hash-style=both -pie" \
481+
PKG_CONFIG_PATH="${INSTALL_DIR}/lib/pkgconfig:${INSTALL_DIR}/lib64/pkgconfig" \
447482
./configure \
448483
--prefix=${INSTALL_DIR} \
449484
--enable-option-checking=fatal \
@@ -513,7 +548,6 @@ COPY --link utils/lib-copy /bref/lib-copy
513548
RUN php /bref/lib-copy/copy-dependencies.php /bref-layer/bin/php /bref-layer/lib
514549
RUN php /bref/lib-copy/copy-dependencies.php /bref-layer/bref/extensions/apcu.so /bref-layer/lib
515550
RUN php /bref/lib-copy/copy-dependencies.php /bref-layer/bref/extensions/intl.so /bref-layer/lib
516-
RUN php /bref/lib-copy/copy-dependencies.php /bref-layer/bref/extensions/opcache.so /bref-layer/lib
517551
RUN php /bref/lib-copy/copy-dependencies.php /bref-layer/bref/extensions/pdo_mysql.so /bref-layer/lib
518552
RUN php /bref/lib-copy/copy-dependencies.php /bref-layer/bref/extensions/pdo_pgsql.so /bref-layer/lib
519553

0 commit comments

Comments
 (0)