Newrelic PHP Agent MUSL: Latest Download URI

Newrelic does not provide a ‘latest’ download URI for the PHP agent. This proves problematic when attempting to inject the agent into PHP container when building in Docker, as version changes will break builds. I have filed a bug to this end:

For now we have implemented a script to accomplish this task.

#!/usr/bin/env sh
set -e

# Get latest download URI.
NEWRELIC_DOWNLOAD_FILE=$(curl -s | sed -rn 's/.*(newrelic-php5-[0-9.]+-linux-musl\.tar\.gz).*/\1/p')

# Install Package.
mkdir -p /opt/newrelic
cd /opt/newrelic
cd /opt/newrelic/newrelic-php5-*
NR_INSTALL_SILENT="true" sh newrelic-install install

# Tidy up temporary files.
rm -f /opt/newrelic/${NEWRELIC_DOWNLOAD_FILE}
rm -f /tmp/nrinstall-*
Post Tags:


comments powered by Disqus