Skip to content

Commit 2279edb

Browse files
Add blackfire probe to all supported PHP versions
1 parent ab14260 commit 2279edb

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

docker-contributor/Dockerfile

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ENV DEBIAN_FRONTEND=noninteractive \
2222
# Install required packages and clean up afterwards to make this image layer smaller
2323
RUN apt-get update \
2424
&& apt-get install --no-install-recommends --no-install-suggests -y \
25-
dumb-init autoconf automake git acl \
25+
curl dumb-init autoconf automake git acl \
2626
gcc g++ make zip unzip mariadb-client \
2727
nginx php8.3 php8.3-cli php8.3-fpm php8.3-zip \
2828
php8.3-gd php8.3-curl php8.3-mysql php8.3-intl \
@@ -93,6 +93,22 @@ RUN for VERSION in $PHPSUPPORTED; do \
9393
done; \
9494
rm -Rf /php-config
9595

96+
# Install blackfire probe
97+
RUN for VERSION in $PHPSUPPORTED; do \
98+
# Blackfire is not available yet for PHP 8.4
99+
if [ "${VERSION}" != "8.4" ]; then \
100+
version=$(php${VERSION} -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION.(PHP_ZTS ? '-zts' : '');") \
101+
&& architecture=$(uname -m) \
102+
&& curl -v -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/$architecture/$version \
103+
&& mkdir -p /tmp/blackfire \
104+
&& tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \
105+
&& mv /tmp/blackfire/blackfire-*.so $(php${VERSION} -r "echo ini_get ('extension_dir');")/blackfire.so \
106+
&& printf "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8307\n" > /etc/php/${VERSION}/fpm/conf.d/blackfire.ini \
107+
&& printf "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8307\n" > /etc/php/${VERSION}/cli/conf.d/blackfire.ini \
108+
&& rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz; \
109+
fi; \
110+
done
111+
96112
# Disable Xdebug by default
97113
RUN phpdismod xdebug
98114

0 commit comments

Comments
 (0)