From 85a1f32b4e397525064b64e080d382b0d914b836 Mon Sep 17 00:00:00 2001 From: Andrew Martlew Date: Fri, 27 Jul 2018 15:06:48 +1000 Subject: [PATCH] Install New Relic (but disable by default) --- Dockerfile | 15 ++++++++++++--- fs/newrelic-install.sh | 16 ---------------- 2 files changed, 12 insertions(+), 19 deletions(-) delete mode 100644 fs/newrelic-install.sh diff --git a/Dockerfile b/Dockerfile index f1b32f8..62a2751 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,10 +2,12 @@ FROM uqlibrary/alpine:3.8 ENV COMPOSER_VERSION=1.6.5 ENV XDEBUG_VERSION=2.7.0alpha1 +ENV NEWRELIC_VERSION=8.1.0.209 +ENV NR_INSTALL_SILENT=1 +ENV NR_INSTALL_PHPLIST=/usr/bin ENV BUILD_DEPS autoconf make g++ gcc groff less file re2c COPY ./fs/docker-entrypoint.sh /usr/sbin/docker-entrypoint.sh -COPY ./fs/newrelic-install.sh /usr/sbin/newrelic-install.sh RUN apk add --upgrade --no-cache \ # Required deps @@ -30,13 +32,20 @@ RUN apk add --upgrade --no-cache \ && curl -sS https://getcomposer.org/installer | php7 -- --install-dir=/usr/bin --filename=composer --version=${COMPOSER_VERSION} \ && composer global require "hirak/prestissimo:0.3.7" \ # + # NewRelic (disabled by default) + && cd /opt \ + && wget -q https://download.newrelic.com/php_agent/archive/${NEWRELIC_VERSION}/newrelic-php5-${NEWRELIC_VERSION}-linux-musl.tar.gz \ + && tar -zxf newrelic-php5-${NEWRELIC_VERSION}-linux-musl.tar.gz \ + && rm -f newrelic-php5-${NEWRELIC_VERSION}-linux-musl.tar.gz + && ./newrelic-php5-${NEWRELIC_VERSION}-linux-musl/newrelic-install install \ + && mv /etc/php7/conf.d/newrelic.ini /etc/newrelic.ini \ + # # Remove build deps && rm -rf /var/cache/apk/* \ && apk del --purge .build-deps \ # # Make scripts executable - && chmod +x /usr/sbin/docker-entrypoint.sh \ - && chmod +x /usr/sbin/newrelic-install.sh + && chmod +x /usr/sbin/docker-entrypoint.sh ADD fs / diff --git a/fs/newrelic-install.sh b/fs/newrelic-install.sh deleted file mode 100644 index e4bd5d3..0000000 --- a/fs/newrelic-install.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -APPLICATION_NAME=${1-Undefined} - -export NR_INSTALL_SILENT=1 -export NR_INSTALL_PHPLIST=/usr/bin -export NR_INSTALL_KEY="${NEWRELIC_LICENSE}" - -NEWRELIC_VERSION="7.4.0.198" -cd /tmp -wget -q https://download.newrelic.com/php_agent/archive/${NEWRELIC_VERSION}/newrelic-php5-${NEWRELIC_VERSION}-linux-musl.tar.gz -tar -zxf newrelic-php5-${NEWRELIC_VERSION}-linux-musl.tar.gz -cd newrelic-php5-${NEWRELIC_VERSION}-linux-musl -./newrelic-install install - -sed -e "s|PHP Application|${APPLICATION_NAME}|g" -i /etc/php7/conf.d/newrelic.ini >/dev/null