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:
- Add the PHP agent install command with install arguments in the Dockerfile.
- Add the S247DataExporter install command with install arguments in the Dockerfile.
- 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