Skip to content

Commit

Permalink
Add blackfire probe to all supported PHP versions
Browse files Browse the repository at this point in the history
  • Loading branch information
nickygerritsen committed Nov 22, 2024
1 parent e2baa9d commit 09c8696
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion docker-contributor/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ENV DEBIAN_FRONTEND=noninteractive \
# Install required packages and clean up afterwards to make this image layer smaller
RUN apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests -y \
dumb-init autoconf automake git acl \
curl dumb-init autoconf automake git acl \
gcc g++ make zip unzip mariadb-client \
nginx php8.3 php8.3-cli php8.3-fpm php8.3-zip \
php8.3-gd php8.3-curl php8.3-mysql php8.3-intl \
Expand Down Expand Up @@ -93,6 +93,22 @@ RUN for VERSION in $PHPSUPPORTED; do \
done; \
rm -Rf /php-config

# Install blackfire probe
RUN for VERSION in $PHPSUPPORTED; do \
# Blackfire is not available yet for PHP 8.4
if [ "${VERSION}" != "8.4" ]; then \
version=$(php${VERSION} -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION.(PHP_ZTS ? '-zts' : '');") \
&& architecture=$(uname -m) \
&& curl -v -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/$architecture/$version \
&& mkdir -p /tmp/blackfire \
&& tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \
&& mv /tmp/blackfire/blackfire-*.so $(php${VERSION} -r "echo ini_get ('extension_dir');")/blackfire.so \
&& printf "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8307\n" > /etc/php/${VERSION}/fpm/conf.d/blackfire.ini \
&& printf "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8307\n" > /etc/php/${VERSION}/cli/conf.d/blackfire.ini \
&& rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz; \
fi; \
done

# Disable Xdebug by default
RUN phpdismod xdebug

Expand Down

0 comments on commit 09c8696

Please sign in to comment.