Help APM APM Insight using PHP Agent Install DataExporter and PHP agent in a Docker

Installing S247DataExporter and the PHP agent in Docker (same container)

Follow the steps below to install S247DataExporter and the PHP agent in a Docker container:

  1. Add the PHP agent install command with install arguments in the Dockerfile.
  2. Add the S247DataExporter install command with install arguments in the Dockerfile.
  3. Start the S247DataExporter from the entrypoint script.

An example Dockerfile

FROM php:7.4-fpm-bullseye
#
#Your code
#
#Prerequisite (ignore if already installed)
RUN apt-get update && apt-get install -y wget unzip procps
#installing the PHP agent
RUN wget -O InstallAgentPHP.sh https://staticdownloads.site24x7.com/apminsight/agents/AgentPHP/linux/InstallAgentPHP.sh
RUN sh InstallAgentPHP.sh -lk "licensekey" -zpa.application_name "PHP-Application"
#installing the S247DataExporter (This is mandatory for the PHP agent to work)
RUN wget -O InstallDataExporter.sh https://staticdownloads.site24x7.com/apminsight/S247DataExporter/linux/InstallDataExporter.sh
RUN sh InstallDataExporter.sh -root -nsvc -lk "licensekey"
#Entrypoint script
COPY ./example-entrypoint.sh /example-entrypoint.sh
ENTRYPOINT [ "sh","/example-entrypoint.sh" ]

 

An example entrypoint script

#!/bin/sh
#Start S247DataExporter
sh /opt/S247DataExporter/bin/service.sh start
#
#Your code
#
php-fpm

 

Related articles

How to install various APM Insight agents in a Docker container
Java | .NET | Node.js | Python

How to install various APM Insight agents in a Kubernetes environment
Java | .NET | PHP | Node.js | Python

Was this document helpful?
Thanks for taking the time to share your feedback. We’ll use your feedback to improve our online help resources.

Help APM APM Insight using PHP Agent Install DataExporter and PHP agent in a Docker