The infrastructure agent support Docker version 1.12 or higher.
make build/base
builds the Docker image from this repo's Dockerfile.
The make target generates the Docker image in steps:
- Adds the
newrelic-infra
agent binary. - Generates and adds a
VERSION
file. - 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/infrastructure
AGENT_VERSION
: Version of thenewrelic-infra
agent
-
Create a workspace directory in the repo root:
mkdir ${PROJECT_ROOT}/workspace
-
Copy or move your
newrelic-infra
binary 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
.