Skip to content

Instantly share code, notes, and snippets.

@satishgadhave
Last active November 2, 2021 06:14
Show Gist options
  • Save satishgadhave/8e33c92fd09992692e19f690302cb416 to your computer and use it in GitHub Desktop.
Save satishgadhave/8e33c92fd09992692e19f690302cb416 to your computer and use it in GitHub Desktop.
NewRelic PHP APM Agent Dockerfile instructions
FROM php:7.4.5-fpm
ARG NEW_RELIC_AGENT_VERSION
ARG NEW_RELIC_LICENSE_KEY
ARG NEW_RELIC_APPNAME
ARG NEW_RELIC_DAEMON_ADDRESS
# Download and install NewRelic PHP extension. This generates newrelic.ini file at /usr/local/etc/php/conf.d/newrelic.ini
RUN curl -L "https://download.newrelic.com/php_agent/archive/${NEW_RELIC_AGENT_VERSION}/newrelic-php5-${NEW_RELIC_AGENT_VERSION}-linux.tar.gz" | tar -C /tmp -zx \
&& export NR_INSTALL_USE_CP_NOT_LN=1 \
&& export NR_INSTALL_SILENT=1 \
&& /tmp/newrelic-php5-*/newrelic-install install \
&& rm -rf /tmp/newrelic-php5-* /tmp/nrinstall*
# Set parameter values in newrelic.ini file e.g. license key
RUN sed -i -e s/\"REPLACE_WITH_REAL_KEY\"/${NEW_RELIC_LICENSE_KEY}/ \
-e s/newrelic.appname[[:space:]]=[[:space:]].\*/newrelic.appname="${NEW_RELIC_APPNAME}"/ \
-e s/\;newrelic.daemon.address[[:space:]]=[[:space:]].\*/newrelic.daemon.address="${NEW_RELIC_DAEMON_ADDRESS}"/ \
/usr/local/etc/php/conf.d/newrelic.ini
@mfsiat
Copy link

mfsiat commented Nov 2, 2021

Hello, after executing the curl command it gives me this error.

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now

Could you please help me to solve the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment