Docker container for the Datadog Agent.
100M+
FROM alpine:3.6
MAINTAINER Datadog <[email protected]>
ARG AGENT_VERSION_ARG=5.31.0
ENV DD_HOME=/opt/datadog-agent \
# prevent the agent from being started after install
DD_START_AGENT=0 \
DOCKER_DD_AGENT=yes \
PYCURL_SSL_LIBRARY=openssl \
AGENT_VERSION=$AGENT_VERSION_ARG \
INTEGRATIONS_VERSION=$AGENT_VERSION_ARG \
DD_ETC_ROOT="/opt/datadog-agent/agent" \
PATH="/opt/datadog-agent/venv/bin:/opt/datadog-agent/agent/bin:$PATH" \
PYTHONPATH="/opt/datadog-agent/agent" \
DD_CONF_LOG_TO_SYSLOG=no \
NON_LOCAL_TRAFFIC=yes \
DD_SUPERVISOR_DELETE_USER=yes \
DD_CONF_PROCFS_PATH="/host/proc"
# Install minimal dependencies
RUN apk add -qU --no-cache coreutils curl curl-dev python-dev tar sysstat tini
# Install build dependencies
ADD https://raw.githubusercontent.com/DataDog/dd-agent/master/packaging/datadog-agent/source/setup_agent.sh /tmp/setup_agent.sh
RUN apk add -qU --no-cache -t .build-deps gcc musl-dev postgresql-dev linux-headers libffi-dev \
# Install the agent
&& sh /tmp/setup_agent.sh \
# Clean build dependencies
&& apk del -q .build-deps \
&& rm /tmp/setup_agent.sh
# Add healthcheck script
COPY probe-alpine.sh $DD_HOME/probe.sh
# Configure the Agent
# and make healthcheck script executable
RUN cp ${DD_ETC_ROOT}/datadog.conf.example ${DD_ETC_ROOT}/datadog.conf \
&& chmod +x $DD_HOME/probe.sh
# Add Docker check
COPY conf.d/docker_daemon.yaml "${DD_ETC_ROOT}/conf.d/docker_daemon.yaml"
# Add install and config files
COPY entrypoint.sh /entrypoint.sh
COPY config_builder.py /config_builder.py
# Extra conf.d and checks.d
VOLUME ["/conf.d", "/checks.d"]
# Expose DogStatsD port
EXPOSE 8125/udp
# Healthcheck
HEALTHCHECK --interval=5m --timeout=3s --retries=1 \
CMD ./probe.sh
ENTRYPOINT ["/sbin/tini", "-g", "--", "/entrypoint.sh"]
WORKDIR $DD_HOME
CMD ["supervisord", "-c", "agent/supervisor.conf"]