title: Get New Relic running in docker container
body: <p>I'm trying to get New Relic running in a docker container (<code>FROM php:7.3-apache</code>) to push up to Cloud Run.</p>
  <p>I've followed this documentation</p>
  <pre><code>https://docs.newrelic.com/docs/agents/php-agent/advanced-installation/docker-other-container-environments-install-php-agent/
  </code></pre>
  <p>For &quot;Install agent and daemon in the same container&quot; and added</p>
  <pre><code>RUN \
    curl -L https://download.newrelic.com/php_agent/release/newrelic-php5-9.17.1.301-linux.tar.gz | tar -C /tmp -zx &amp;&amp; \
    export NR_INSTALL_USE_CP_NOT_LN=1 &amp;&amp; \
    export NR_INSTALL_SILENT=1 &amp;&amp; \
    /tmp/newrelic-php5-*/newrelic-install install &amp;&amp; \
    rm -rf /tmp/newrelic-php5-* /tmp/nrinstall* &amp;&amp; \
    sed -i \
        -e 's/&quot;REPLACE_WITH_REAL_KEY&quot;/&quot;NRAK-xxxxxxxxxxxxxxxxxxx&quot;/' \
        -e 's/newrelic.appname = &quot;PHP Application&quot;/newrelic.appname = &quot;My apps real name&quot;/' \
        -e 's/;newrelic.daemon.app_connect_timeout =.*/newrelic.daemon.app_connect_timeout=15s/' \
        -e 's/;newrelic.daemon.start_timeout =.*/newrelic.daemon.start_timeout=5s/' \
        /usr/local/etc/php/conf.d/newrelic.ini
  </code></pre>
  <p>To my docker file and switched the 3 variables to real values.</p>
  <p>When I do PS inside the container it looks like it's running but nothing is appearing in the New Relic dashboard.</p>
  <p><a href="https://i.stack.imgur.com/L2885.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/L2885.png" alt="enter image description here" /></a></p>
  <p>When I cat out php_agent.log I get</p>
  <pre><code>2021-06-21 19:06:34.870 +0000 (1 1) info: attempt daemon connection via '@newrelic'
  2021-06-21 19:06:34.871 +0000 (1 1) info: New Relic 9.17.1.301 (&quot;xigua&quot; - &quot;6498785b65c7&quot;) [daemon='@newrelic'  php='7.3.28' zts=no sapi='apache2handler' apache='2.4.38' mpm=prefork pid=1 ppid=0 uid=0 euid=0 gid=0 egid=0 backtrace=yes 
  startup=agent os='Linux' rel='4.19.128-microsoft-standard' mach='x86_64' ver='#1 SMP Tue Jun 23 12' node='544d6a6fd26a']
  2021-06-21 19:06:34.871 +0000 (1 1) warning: A global default license has not been set or has invalid format. Please add a 'newrelic.license' key in the global php.ini or in the newrelic.ini file, or ensure that a valid license is provided on a per-virtual host or per-directory basis.
  </code></pre>
  <p>When I cat out newrelic-daemon.log I get</p>
  <pre><code>2021/06/21 19:06:34.974122 (17) Info: New Relic daemon version 9.17.1.301-6498785b65c7 [listen=&quot;@newrelic&quot; startup=agent pid=17 ppid=1 uid=0 euid=0 gid=0 egid=0 runtime=&quot;go1.9.7&quot; GOMAXPROCS=24 GOOS=linux GOARCH=amd64]
  2021/06/21 19:06:35.024983 (36) Info: New Relic daemon version 9.17.1.301-6498785b65c7 [listen=&quot;@newrelic&quot; startup=agent pid=36 ppid=17 uid=0 euid=0 gid=0 egid=0 runtime=&quot;go1.9.7&quot; GOMAXPROCS=24 GOOS=linux GOARCH=amd64]
  2021/06/21 19:06:35.071290 (53) Info: New Relic daemon version 9.17.1.301-6498785b65c7 [listen=&quot;@newrelic&quot; startup=agent pid=53 ppid=36 uid=0 euid=0 gid=0 egid=0 runtime=&quot;go1.9.7&quot; GOMAXPROCS=24 GOOS=linux GOARCH=amd64]
  2021/06/21 19:06:35.071516 (53) Info: collector configuration is &amp;{CAFile: CAPath: Proxy:}
  2021/06/21 19:06:35.071855 (53) Info: daemon listening on @newrelic
  </code></pre>
  <p><code>php --ini</code> gives me</p>
  <pre><code>Configuration File (php.ini) Path: /usr/local/etc/php
  Loaded Configuration File:         (none)
  Scan for additional .ini files in: /usr/local/etc/php/conf.d
  Additional .ini files parsed:      /usr/local/etc/php/conf.d/docker-php-ext-imap.ini,
  /usr/local/etc/php/conf.d/docker-php-ext-mysqli.ini,
  /usr/local/etc/php/conf.d/docker-php-ext-pdo_mysql.ini,
  /usr/local/etc/php/conf.d/docker-php-ext-sodium.ini,
  /usr/local/etc/php/conf.d/docker-php-ext-zip.ini,
  /usr/local/etc/php/conf.d/newrelic.ini
  </code></pre>
  <p>When I  <code>cat /usr/local/etc/php/conf.d/newrelic.ini | grep &quot;newrelic.license&quot;</code> I get my real correct key</p>
  <pre><code>; Setting: newrelic.license
  newrelic.license = &quot;NRAK-xxxxxxxxxxxxxxxxxxxxx&quot;
  </code></pre>
  <p>What am I doing wrong or what step have I missed?</p>