Skip to content
Merged
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
15 changes: 15 additions & 0 deletions layers/protobuf/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ARG PHP_VERSION
ARG BREF_VERSION
FROM bref/build-php-$PHP_VERSION:$BREF_VERSION AS ext

RUN MAKEFLAGS="-j $(nproc)" pecl install protobuf > /dev/null
RUN cp `php-config --extension-dir`/protobuf.so /tmp/protobuf.so
RUN strip --strip-debug /tmp/protobuf.so
RUN echo 'extension=protobuf.so' > /tmp/ext.ini

# Build the final image with just the files we need
FROM scratch

# Copy things we installed to the final image
COPY --from=ext /tmp/protobuf.so /opt/bref/extensions/protobuf.so
COPY --from=ext /tmp/ext.ini /opt/bref/etc/php/conf.d/ext-protobuf.ini
8 changes: 8 additions & 0 deletions layers/protobuf/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"php": [
"81",
"82",
"83",
"84"
]
}
8 changes: 8 additions & 0 deletions layers/protobuf/test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

if (!class_exists($function = \Google\Protobuf\Any::class)) {
echo sprintf('FAIL: Class "%s" does not exist.', $function) . PHP_EOL;
exit(1);
}

exit(0);
Loading