-
Notifications
You must be signed in to change notification settings - Fork 189
/
Dockerfile-alpine
62 lines (48 loc) · 1.86 KB
/
Dockerfile-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
56
57
58
59
60
61
62
FROM alpine:3.6
MAINTAINER Datadog <[email protected]>
ARG AGENT_VERSION_ARG=5.32.7
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"]