diff --git a/layers/opentelemetry/Dockerfile b/layers/opentelemetry/Dockerfile new file mode 100644 index 00000000..cb4b12c5 --- /dev/null +++ b/layers/opentelemetry/Dockerfile @@ -0,0 +1,17 @@ +# https://github.com/brefphp/extra-php-extensions/blob/master/layers/yaml/Dockerfile + +ARG PHP_VERSION +ARG BREF_VERSION +FROM bref/build-php-$PHP_VERSION:$BREF_VERSION AS ext + +RUN MAKEFLAGS="-j $(nproc)" && pecl install opentelemetry > /dev/null +RUN cp `php-config --extension-dir`/opentelemetry.so /tmp/opentelemetry.so +RUN strip --strip-debug /tmp/opentelemetry.so +RUN echo 'extension=opentelemetry.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/opentelemetry.so /opt/bref/extensions/opentelemetry.so +COPY --from=ext /tmp/ext.ini /opt/bref/etc/php/conf.d/ext-opentelemetry.ini diff --git a/layers/opentelemetry/config.json b/layers/opentelemetry/config.json new file mode 100644 index 00000000..a5a35316 --- /dev/null +++ b/layers/opentelemetry/config.json @@ -0,0 +1,7 @@ +{ + "php": [ + "80", + "81", + "82" + ] +} diff --git a/layers/opentelemetry/test.php b/layers/opentelemetry/test.php new file mode 100644 index 00000000..f7fe507c --- /dev/null +++ b/layers/opentelemetry/test.php @@ -0,0 +1,8 @@ +