forked from DataDog/docker-dd-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-dogstatsd
46 lines (36 loc) · 1.61 KB
/
Dockerfile-dogstatsd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
FROM debian:jessie
MAINTAINER Datadog <[email protected]>
ENV DOCKER_DD_AGENT=yes \
AGENT_VERSION=1:5.16.0-1 \
DD_ETC_ROOT=/etc/dd-agent \
PATH="/opt/datadog-agent/embedded/bin:/opt/datadog-agent/bin:${PATH}" \
PYTHONPATH=/opt/datadog-agent/agent \
DD_CONF_LOG_TO_SYSLOG=no \
NON_LOCAL_TRAFFIC=yes
# Install the Agent
RUN echo "deb http://apt.datadoghq.com/ stable main" > /etc/apt/sources.list.d/datadog.list \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C7A7DA52 \
&& apt-get update \
&& apt-get install --no-install-recommends -y datadog-agent="${AGENT_VERSION}" ca-certificates \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Add install and config files
COPY entrypoint-dogstatsd.sh /entrypoint.sh
COPY dogstatsd/supervisor.conf /etc/dd-agent/supervisor.conf
COPY config_builder.py /config_builder.py
RUN mv /etc/dd-agent/datadog.conf.example /etc/dd-agent/datadog.conf \
# Set proper permissions to allow running as a non-root user
&& chmod g+w /etc/dd-agent/datadog.conf \
&& chmod -R g+w /var/log/datadog \
&& chmod g+w /etc/dd-agent \
&& chmod g+w /opt/datadog-agent/run/
# Expose supervisor, DogStatsD and trace-agent port
EXPOSE 9001/tcp 8125/udp 8126/tcp
# Healthcheck
HEALTHCHECK --interval=5m --timeout=3s --retries=1 \
CMD test $(/opt/datadog-agent/embedded/bin/python /opt/datadog-agent/bin/supervisorctl \
-c /etc/dd-agent/supervisor.conf status | awk '{print $2}' | egrep -v 'RUNNING|EXITED' | wc -l) \
-eq 0 || exit 1
ENTRYPOINT ["/entrypoint.sh"]
USER 1001
CMD ["supervisord", "-n", "-c", "/etc/dd-agent/supervisor.conf"]