The infrastructure agent support Docker version 1.12 or higher.
Be sure you already built the agent binaries, so these should be available at project root target/ folder.
make build/base builds the Docker image from this repo's Dockerfile.
The make target generates the Docker image in steps:
- Adds the
newrelic-infraagent binary. - Generates and adds a
VERSIONfile. - Adds all files in static assets.
- Sets image labels.
- Sets image environment variables required for the agent to run correctly inside a container.
See the comments in Makefile for the required env vars.
To build the Linux binary, see the README instructions. That will produce the newrelic-infra binary in target/bin/.
-
Set the following environment variables:
PROJECT_ROOT: Path to this cloned repo's rootIMAGE_VERSION: Version to use for the Docker imageIMAGE_TAG:newrelic/infrastructureAGENT_VERSION: Version of thenewrelic-infraagent
-
Create a workspace directory in the repo root:
mkdir ${PROJECT_ROOT}/workspace -
Copy or move your
newrelic-infrabinary into${PROJECT_ROOT}/workspace/. The binary must be namednewrelic-infra. -
Run the make target:
make build/base
This should build the Docker image newrelic/infrastructure and tag it with latest.