Agent as a container
As mentioned earlier, the Datadog Agent can be installed as a container on a Docker host. Though the actual options might differ, the following is a sample command that explains how the Datadog Agent is started up as a container:
DOCKER_CONTENT_TRUST=1 docker run -d --name dd-agent -v /var/run/docker.sock:/var/run/docker.sock:ro -v /proc/:/host/proc/:ro -v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro -e DD_API_KEY=<DATADOG_API_KEY> datadog/agent:7 Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
The Docker image of Datadog Agent 7 is pulled from Docker Hub in this example.
When the agent is installed on the host, you have seen that datadog.yaml
is used to set the configuration items. With a Docker image, that option is not directly available. However, any custom changes in it could be done by setting the corresponding environment variables. For example, in this example, api_key
is set by passing the DD_API_ KEY...