I’m having an issue enabling the nginx-nr-agent (newrelic nginx plugin) on top of the official nginx container. The container builds fine but only starts and runs the nginx-nr-agent, but not the nginx process itself. The agent seems to be configured correctly as the logs show it trying to poll the nginx status page but since the nginx process isn’t running it just says it can’t connect. Relevant docker-compose and Dockerfile pasted below.
It looks like your image is specifically starting nginx-nr-agent.py as the pid1 of this container. This overrides the default CMD, which starts nginx as the pid1 of the container.
There are a few approaches you could take. You could run something else as the pid1 (like maybe supervisor or runit) that is in turn configured to run both nginx and nginx-nr-agent.py.
Another possibility might be to run nginx-nr-agent in its own container. I don’t know enough about how it works to know for certain that is an option. If it is trying to connect to nginx, that suggests that it may be runnable as a separate container.
This container built correctly and the newrelic agent container is able to successfully poll the nginx container according to the logs. But I’m getting some kind of SSL error that seems to be keeping the agent from forwarding the collected stats to NewRelic itself.