-
Notifications
You must be signed in to change notification settings - Fork 189
/
Dockerfile-dogstatsd-alpine
55 lines (42 loc) · 1.68 KB
/
Dockerfile-dogstatsd-alpine
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
47
48
49
50
51
52
53
54
55
FROM alpine:3.6
MAINTAINER Datadog <[email protected]>
ARG AGENT_VERSION_ARG=5.32.7
ENV DD_HOME=/opt/datadog-agent \
DOCKER_DD_AGENT=yes \
# prevent the agent from being started after install
DD_START_AGENT=0 \
AGENT_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
# Install minimal dependencies
RUN apk add -qU --no-cache curl-dev python-dev tar sysstat ca-certificates
# 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 curl gcc musl-dev linux-headers \
# Install the agent
&& DD_SKIP_INTEGRATIONS=1 sh /tmp/setup_agent.sh \
# Clean build dependencies
&& apk del -q .build-deps \
# Clean up the install script
&& rm /tmp/setup_agent.sh
# Add install and config files
COPY entrypoint-dogstatsd.sh /entrypoint.sh
COPY dogstatsd/supervisor-alpine.conf $DD_HOME/agent/supervisor.conf
COPY config_builder.py /config_builder.py
# Add healthcheck script
COPY probe-alpine.sh $DD_HOME/probe.sh
# Set proper permissions to allow running as a non-root user
RUN mv $DD_HOME/agent/datadog.conf.example $DD_HOME/agent/datadog.conf \
&& chmod -R g+wx $DD_HOME \
&& chmod g+x /entrypoint.sh \
&& chmod +x $DD_HOME/probe.sh
# Expose DogStatsD port
EXPOSE 8125/udp
HEALTHCHECK --interval=5m --timeout=3s --retries=1 \
CMD ./probe.sh
ENTRYPOINT ["/entrypoint.sh"]
USER 1001
CMD supervisord -n -c $DD_HOME/agent/supervisor.conf