Your data. Anywhere you go.

New Relic for iOS or Android

Download on the App Store    Android App on Google play

New Relic Insights App for iOS

Download on the App Store

Learn more

Close icon

NGINX Infrastructure NGINX agent in container error


New Relic Infrastructure Question Template

Hello - attempting to configure an install of new relic infrastructure agent on a container running NGINX (debian 10). I am following the instructions provided in the “Add” section of our account. In the dockerfile I do the following:

1). Create a configuration file and add your license key

RUN echo "license_key: <KEY_HERE>" | tee -a /etc/newrelic-infra.yml

2). Enable New Relic’s GPG key

RUN curl | apt-key add -

2). Create the agent’s apt repo using the command for your distribution version

RUN printf "deb [arch=amd64] buster main" | sudo tee -a /etc/apt/sources.list.d/newrelic-infra.list
  1. Update apt-cache and install
RUN sudo apt-get update
RUN sudo apt-get install newrelic-infra -y

However the build fails on step 3 with the following output. Is this the preferred way to install in this scenario (NGINX in a container)?

Step 29/31 : RUN apt-get install newrelic-infra -y
 ---> Running in 905baf48204e
Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 0 to remove and 20 not upgraded.
Need to get 10.9 MB of archives.
After this operation, 36.4 MB of additional disk space will be used.
Get:1 buster/main amd64 newrelic-infra amd64 1.8.1 [10.9 MB]
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at /usr/share/perl5/Debconf/FrontEnd/ line 7, <> line 1.)
debconf: falling back to frontend: Teletype
dpkg-preconfigure: unable to re-open stdin:
Fetched 10.9 MB in 11s (989 kB/s)
Selecting previously unselected package newrelic-infra.
(Reading database ... 7998 files and directories currently installed.)
Preparing to unpack .../newrelic-infra_1.8.1_amd64.deb ...
Unpacking newrelic-infra (1.8.1) ...
Setting up newrelic-infra (1.8.1) ...
/var/lib/dpkg/info/newrelic-infra.postinst: 44: /var/lib/dpkg/info/newrelic-infra.postinst: systemctl: not found
dpkg: error processing package newrelic-infra (--configure):
 subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)
The command '/bin/sh -c apt-get install newrelic-infra -y' returned a non-zero code: 100


Hello @sai.nimmagadda,

We don’t yet have support for running both the Infra Agent and the NGINX integration within containers. WE would recommend running the agent/integration outside a container environment with the integration targeting your NGINX environment.