Docker and other container environments: Install C SDK

You can install the New Relic C SDK on a Docker container (or other container) to monitor one or more of your C applications.

Install C SDK in container environment


To install C SDK for a container environment, we recommend installing the C SDK daemon on a separate docker container:

Data transmitted from the agent to the daemon is not encrypted. We recommend only using a private network connection between the agent and daemon (this only applies when the agent and daemon are running on different hosts).

  1. Set up a daemon container:
    1. Install the daemon by cloning the C SDK repository and building the daemon. This is done most effectively via the command make daemon. See the for further details.
    2. Start the daemon using --address and --watchdog-foreground arguments. The --address argument is used to set a port the daemon is accepting connections on. The --watchdog-foreground argument ensures that the daemon runs in the foreground.
  2. Use the C SDK in your containerized application:
    1. Follow the steps to add the C SDK to your code.
    2. Point the C SDK to the daemon by adding a newrelic_init call and passing a valid address argument. The value for this argument needs to be HOST:PORT, where HOST is the name or IP address of the host the daemon is running on, and PORT is the port number the daemon is listening on.

For more help

If you need more help, check out these support and learning resources: