Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .prettyci.composer.json

This file was deleted.

14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Change log

## 3.0.0

- Bref v3 compatibility.
- No longer compatible with Bref v2. If you use Bref v2, use the `1.x` version of the Bref extra extensions.

## 2.0.0

There is no 2.0.0 version. We're skipping v2 to jump to v3 to align with the version of Bref.

As a reminder:

- v1 of the extra extensions is compatible with Bref v2 (that was confusing).
- v3 of the extra extensions is compatible with Bref v3.

## 1.8.7

- Updated Blackfire to version 1.92.53.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ SHELL := /bin/bash
layer ?= *
resolve_php_versions = $(or $(php_versions),`jq -r '.php | join(" ")' ${1}/config.json`)
resolve_tags = `./new-docker-tags.php $(DOCKER_TAG)`
BREF_VERSION = 2
BREF_VERSION = 3

define build_docker_image
docker build -t bref/${1}-php-${2} --build-arg PHP_VERSION=${2} --build-arg BREF_VERSION=${BREF_VERSION} ${DOCKER_BUILD_FLAGS} ${1}
Expand Down
10 changes: 6 additions & 4 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ a limit of 5 layers per Lambda. You can also utilise the provided docker images

> **Note**
>
> If you are using Bref v2, you need to use version `1.x` of the `bref/extra-php-extensions` package.
> If you are using Bref v3, you need to use version `3.x` of the `bref/extra-php-extensions` package.
>
> There is no version `2.x` of the `bref/extra-php-extensions` package.
>
> If you are using Bref v1, you need to use version `0.x` of the `bref/extra-php-extensions` package.
> If you are using Bref v2, you need to use version `1.x` of the `bref/extra-php-extensions` package.


> **Warning**
>
> **ARM64 is not supported yet with Bref v2.**
> **ARM64 is not supported with extra extensions.**


We are happy to get contributions for other extensions. Sky is the limit! (And also your knowledge with Docker...)
Expand Down Expand Up @@ -43,7 +45,7 @@ functions:
handler: bin/console
runtime: php-81
layers:
- ${bref-extra:amqp-php-81} # <----- Example for AMQP layer
- ${bref-extra:amqp-php-83} # <----- Example for AMQP layer
```

### Available layers
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
"async-aws/core": "^1.7",
"symfony/http-client": "^5.4",
"async-aws/lambda": "^1.1",
"bref/logger": "^1.0"
"bref/logger": "^2.0"
},
"autoload-dev": {
"psr-4": {
"Bref\\Extra\\": "src/"
}
},
"conflict": {
"bref/bref": "<2.1.15"
"bref/bref": "<3.0.0"
},
"license": "MIT",
"authors": [
Expand Down
7 changes: 3 additions & 4 deletions layers/amqp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ RUN mkdir -p ${AMQP_BUILD_DIR}

# Compile rabbitmq
WORKDIR ${AMQP_BUILD_DIR}
# Currently it is not possible to use newer rabbitmq-c version than 0.13.0 because this is
# last version which supports CMake 3.17 which is latest available version in Amazon Linux 2.
RUN LD_LIBRARY_PATH= dnf install -y cmake
RUN curl -Ls -o rabbitmq-c.tar.gz https://github.com/alanxz/rabbitmq-c/archive/refs/tags/v0.13.0.tar.gz
RUN tar xzf rabbitmq-c.tar.gz
WORKDIR ${AMQP_BUILD_DIR}/rabbitmq-c-0.13.0
Expand All @@ -19,9 +18,9 @@ RUN cmake --build . --target install

# Compile the php amqp extension
WORKDIR ${AMQP_BUILD_DIR}
RUN git clone https://github.com/php-amqp/php-amqp
RUN curl -Ls -o php-amqp.tar.gz https://github.com/php-amqp/php-amqp/archive/refs/tags/v2.1.2.tar.gz && \
tar xzf php-amqp.tar.gz && mv php-amqp-2.1.2 php-amqp
WORKDIR ${AMQP_BUILD_DIR}/php-amqp
RUN git checkout v2.1.2
RUN phpize
RUN ./configure
RUN make -j $(nproc)
Expand Down
2 changes: 0 additions & 2 deletions layers/amqp/config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"php": [
"80",
"81",
"82",
"83",
"84"
Expand Down
2 changes: 0 additions & 2 deletions layers/blackfire/config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"php": [
"80",
"81",
"82",
"83",
"84"
Expand Down
2 changes: 1 addition & 1 deletion layers/bsdiff/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM bref/build-php-$PHP_VERSION:$BREF_VERSION AS ext

RUN set -ex && \
LD_LIBRARY_PATH= && \
yum -y install bzip2-devel && \
dnf -y install bzip2-devel && \
pecl channel-update pecl.php.net && \
yes '' | pecl install bsdiff-stable && \
cp "$(php-config --extension-dir)/bsdiff.so" /tmp/bsdiff.so && \
Expand Down
2 changes: 0 additions & 2 deletions layers/bsdiff/config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"php": [
"80",
"81",
"82",
"83",
"84"
Expand Down
2 changes: 0 additions & 2 deletions layers/calendar/config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"php": [
"80",
"81",
"82",
"83",
"84"
Expand Down
1 change: 1 addition & 0 deletions layers/datadog/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ RUN cp "$(php-config --extension-dir)/ddtrace.so" /tmp/ddtrace.so && \

RUN sed -i 's/extension = ddtrace\.so/extension = \/opt\/bref-extra\/ddtrace.so/' /tmp/ext.ini && \
sed -i 's/extension = datadog-profiling\.so/extension = \/opt\/bref-extra\/datadog-profiling.so/' /tmp/ext.ini && \
sed -i '/extension = ddappsec\.so/d' /tmp/ext.ini && \

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

sed -i 's/;datadog\.agent_host.*$/datadog\.agent_host = 127.0.0.1/' /tmp/ext.ini && \
sed -i 's/^.*datadog\.appsec\.enabled.*$/datadog.appsec.enabled = Off/' /tmp/ext.ini && \
sed -i 's/datadog\.profiling\.enabled = On/datadog.profiling.enabled = 1/' /tmp/ext.ini
Expand Down
2 changes: 0 additions & 2 deletions layers/datadog/config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"php": [
"80",
"81",
"82",
"83",
"84"
Expand Down
5 changes: 0 additions & 5 deletions layers/decimal/config.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
{
"php": [
"80",
"81",
"82",
"83",
"84"
]
}
2 changes: 0 additions & 2 deletions layers/ds/config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"php": [
"80",
"81",
"82",
"83",
"84"
Expand Down
2 changes: 1 addition & 1 deletion layers/elastic-apm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ARG BREF_VERSION
FROM bref/build-php-$PHP_VERSION:$BREF_VERSION AS ext

RUN \
LD_LIBRARY_PATH=/lib64:/lib yum install -y libcurl-devel openssl-devel \
LD_LIBRARY_PATH=/lib64:/lib dnf install -y libcurl-devel openssl-devel \
&& mkdir /tmp/apm \
&& curl -L https://github.com/elastic/apm-agent-php/archive/refs/tags/v1.8.4.tar.gz | tar -C /tmp/apm -zx --strip-components=1 \
&& cd /tmp/apm/src/ext \
Expand Down
2 changes: 0 additions & 2 deletions layers/elastic-apm/config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"php": [
"80",
"81",
"82",
"83"
]
Expand Down
2 changes: 0 additions & 2 deletions layers/excimer/config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"php": [
"80",
"81",
"82",
"83",
"84"
Expand Down
2 changes: 1 addition & 1 deletion layers/gd/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ FROM bref/build-php-$PHP_VERSION:$BREF_VERSION AS ext
# Install required build libraries
RUN set -ue \
; LD_LIBRARY_PATH= \
; yum -y install \
; dnf -y install \
libwebp-devel \
libXpm-devel \
libpng-devel \
Expand Down
2 changes: 0 additions & 2 deletions layers/gd/config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"php": [
"80",
"81",
"82",
"83",
"84"
Expand Down
2 changes: 1 addition & 1 deletion layers/gmp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ FROM bref/build-php-$PHP_VERSION:$BREF_VERSION AS ext
ENV LD_LIBRARY_PATH=/usr/lib:/usr/lib64:$LD_LIBRARY_PATH

# Install packages
RUN yum install -y gmp-devel
RUN dnf install -y gmp-devel

# Build PHP extension
WORKDIR ${PHP_BUILD_DIR}/ext/gmp
Expand Down
2 changes: 0 additions & 2 deletions layers/gmp/config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"php": [
"80",
"81",
"82",
"83",
"84"
Expand Down
2 changes: 1 addition & 1 deletion layers/gnupg/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ARG BREF_VERSION
FROM bref/build-php-$PHP_VERSION:$BREF_VERSION AS ext

ENV LD_LIBRARY_PATH=/usr/lib:/usr/lib64:$LD_LIBRARY_PATH
RUN yum install -y gpgme-devel
RUN dnf install -y gpgme-devel

RUN pecl install gnupg
RUN cp `php-config --extension-dir`/gnupg.so /tmp/gnupg.so
Expand Down
1 change: 0 additions & 1 deletion layers/gnupg/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"php": [
"81",
"82",
"83",
"84"
Expand Down
2 changes: 0 additions & 2 deletions layers/grpc/config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"php": [
"80",
"81",
"82",
"83",
"84"
Expand Down
7 changes: 4 additions & 3 deletions layers/h3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ RUN mkdir -p ${H3_BUILD_DIR}

# Compile h3
WORKDIR ${H3_BUILD_DIR}
RUN git clone https://github.com/uber/h3.git && \
cd h3 && \
git checkout v3.7.2 && \
RUN LD_LIBRARY_PATH= dnf install -y cmake
RUN curl -Ls -o h3.tar.gz https://github.com/uber/h3/archive/refs/tags/v3.7.2.tar.gz && \
tar xzf h3.tar.gz && \
cd h3-3.7.2 && \
cmake -DBUILD_SHARED_LIBS=ON . && \
make -j "$(nproc)" && \
make install
Expand Down
2 changes: 0 additions & 2 deletions layers/h3/config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"php": [
"80",
"81",
"82",
"83",
"84"
Expand Down
2 changes: 0 additions & 2 deletions layers/igbinary/config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"php": [
"80",
"81",
"82",
"83",
"84"
Expand Down
28 changes: 8 additions & 20 deletions layers/imagick/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,20 @@ ENV IMAGICK_VERSION="7.1.1-38"
ENV AOM_VERSION="3.10.0"
ENV LIBHEIF_VERSION="1.19.3"
ENV LIBDE265_VERSION="1.0.15"
ENV LIBWEBP_VERSION="1.4.0"
ENV GS_VERSION="9.56.1"
ENV IMAGICK_EXT_COMMIT="28f27044e435a2b203e32675e942eb8de620ee58"

# Prepare environment
ENV IMAGICK_BUILD_DIR=${BUILD_DIR}/imagick
RUN mkdir -p ${IMAGICK_BUILD_DIR}
WORKDIR ${IMAGICK_BUILD_DIR}
RUN LD_LIBRARY_PATH= yum -y install libpng-devel libjpeg-devel lcms2-devel ImageMagick-devel nasm gcc10 gcc10-c++

# Use gcc10 as the default compiler, needed for AOM
ENV CXX="/usr/bin/gcc10-g++"
ENV CC="/usr/bin/gcc10-gcc"

# Compile libwebp since AL2 ships with v0.3, and v0.4 or higher is required to builder the other libs
RUN curl -Ls -o libwebp.tar.gz https://github.com/webmproject/libwebp/archive/refs/tags/v${LIBWEBP_VERSION}.tar.gz && tar xzf libwebp.tar.gz && rm libwebp.tar.gz \
&& cd ${IMAGICK_BUILD_DIR}/libwebp-${LIBWEBP_VERSION} \
&& autoreconf -i && automake && autoconf \
&& ./configure --prefix ${INSTALL_DIR} --exec-prefix ${INSTALL_DIR} \
&& make -j $(nproc) && make install && rm -rf ${IMAGICK_BUILD_DIR}/libwebp-${LIBWEBP_VERSION}
RUN LD_LIBRARY_PATH= dnf -y install libpng-devel libjpeg-devel lcms2-devel libwebp-devel nasm cmake

# Compile AOM (libavif dependency for AVIF support)
RUN git clone -b v${AOM_VERSION} --depth 1 https://aomedia.googlesource.com/aom \
RUN curl -Ls -o aom.tar.gz https://storage.googleapis.com/aom-releases/libaom-${AOM_VERSION}.tar.gz && tar xzf aom.tar.gz && rm aom.tar.gz \
&& mkdir -p ${IMAGICK_BUILD_DIR}/aom_build && cd ${IMAGICK_BUILD_DIR}/aom_build \
&& cmake ../aom -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} -DBUILD_SHARED_LIBS=1 -DENABLE_DOCS=0 -DENABLE_EXAMPLES=0 -DENABLE_TESTDATA=0 -DENABLE_TESTS=0 -DENABLE_TOOLS=0 \
&& make -j $(nproc) && make install && rm -rf ${IMAGICK_BUILD_DIR}/aom && rm -rf ${IMAGICK_BUILD_DIR}/aom_build
&& cmake ../libaom-${AOM_VERSION} -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} -DBUILD_SHARED_LIBS=1 -DENABLE_DOCS=0 -DENABLE_EXAMPLES=0 -DENABLE_TESTDATA=0 -DENABLE_TESTS=0 -DENABLE_TOOLS=0 \
&& make -j $(nproc) && make install && rm -rf ${IMAGICK_BUILD_DIR}/libaom-${AOM_VERSION} && rm -rf ${IMAGICK_BUILD_DIR}/aom_build

# Compile libde265 (libheif dependency)
RUN curl -Ls -o libde265.tar.gz https://github.com/strukturag/libde265/releases/download/v${LIBDE265_VERSION}/libde265-${LIBDE265_VERSION}.tar.gz && tar xzf libde265.tar.gz && rm libde265.tar.gz \
Expand All @@ -46,21 +34,21 @@ RUN curl -Ls -o libheif.tar.gz https://github.com/strukturag/libheif/releases/do
&& cmake --preset=release-noplugins .. -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \
&& make -j $(nproc) && make install && rm -rf ${IMAGICK_BUILD_DIR}/libheif-${LIBHEIF_VERSION}

# Compile gs
# Compile ghostscript from source (the system package requires too many runtime files)
RUN curl -Ls -o ghostscript.tar.gz https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs9561/ghostscript-${GS_VERSION}.tar.gz && tar xzf ghostscript.tar.gz && rm ghostscript.tar.gz \
&& mkdir -p ${IMAGICK_BUILD_DIR}/ghostscript-${GS_VERSION} && cd ${IMAGICK_BUILD_DIR}/ghostscript-${GS_VERSION} \
&& ./configure --prefix ${INSTALL_DIR} --exec-prefix ${INSTALL_DIR} --without-x \
&& make -j $(nproc) && cp bin/gs /tmp/gs && rm -rf ${IMAGICK_BUILD_DIR}/ghostscript-${GS_VERSION}

# Compile the ImageMagick library
# Compile the ImageMagick library (AL2023 only has v6, we need v7)
RUN curl -Ls -o ImageMagick.tar.gz https://github.com/ImageMagick/ImageMagick/archive/refs/tags/${IMAGICK_VERSION}.tar.gz && tar xzf ImageMagick.tar.gz && rm ImageMagick.tar.gz \
&& cd ${IMAGICK_BUILD_DIR}/ImageMagick-${IMAGICK_VERSION} \
&& ./configure --prefix ${INSTALL_DIR} --exec-prefix ${INSTALL_DIR} --with-webp --with-heic --disable-static --with-freetype=yes \
&& make -j $(nproc) && make install && rm -rf ${IMAGICK_BUILD_DIR}/ImageMagick-${IMAGICK_VERSION} && convert -list configure

# Compile the php imagick extension and copy the dependencies
RUN git clone https://github.com/Imagick/imagick && cd imagick \
&&git reset --hard ${IMAGICK_EXT_COMMIT} \
RUN curl -Ls -o imagick.tar.gz https://github.com/Imagick/imagick/archive/${IMAGICK_EXT_COMMIT}.tar.gz && tar xzf imagick.tar.gz && rm imagick.tar.gz \
&& cd imagick-${IMAGICK_EXT_COMMIT} \
&& phpize && ./configure --with-imagick=${INSTALL_DIR} \
&& make -j $(nproc) && make install && cp `php-config --extension-dir`/imagick.so /tmp/imagick.so && strip --strip-debug /tmp/imagick.so && echo 'extension=imagick.so' > /tmp/ext.ini \
&& php /bref/lib-copy/copy-dependencies.php /tmp/imagick.so /tmp/extension-libs
Expand Down
2 changes: 0 additions & 2 deletions layers/imagick/config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"php": [
"80",
"81",
"82",
"83",
"84"
Expand Down
4 changes: 0 additions & 4 deletions layers/imap/config.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
"php": [
"80",
"81",
"82",
"83"
]
}
2 changes: 1 addition & 1 deletion layers/ldap/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM bref/build-php-$PHP_VERSION:$BREF_VERSION AS ext

ENV LD_LIBRARY_PATH=/usr/lib:/usr/lib64:$LD_LIBRARY_PATH

RUN yum -y install openldap-devel
RUN dnf -y install openldap-devel

WORKDIR ${PHP_BUILD_DIR}/ext/ldap
RUN phpize
Expand Down
2 changes: 0 additions & 2 deletions layers/ldap/config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"php": [
"80",
"81",
"82",
"83",
"84"
Expand Down
Loading
Loading