在 Docker 中安装 S247DataExporter 和 PHP agent(同一容器)
请按照以下步骤在 Docker 容器中安装 S247DataExporter 和 PHP agent:
- 在 Dockerfile 中添加带有安装参数的 PHP agent 安装命令。
- 在 Dockerfile 中添加带有安装参数的 S247DataExporter 安装命令。
- 从 entrypoint 脚本启动 S247DataExporter。
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" ]
入口脚本示例
#!/bin/sh
#Start S247DataExporter
sh /opt/S247DataExporter/bin/service.sh start
#
#Your code
#
php-fpm
相关文章
如何在 Docker 容器中安装各种 APM Insight agent
Java | .NET | Node.js | Python
如何在 Kubernetes 环境中安装各种 APM Insight agent
Java | .NET | PHP | Node.js | Python
-
本页内容
- Dockerfile 示例
- 入口脚本示例
- 相关文章
