-
Notifications
You must be signed in to change notification settings - Fork 12
/
Dockerfile
44 lines (36 loc) · 1.37 KB
/
Dockerfile
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
# Docker image containing the Diamond collector
#
# VERSION 0.0.1
FROM ubuntu:14.04
MAINTAINER Pierig Le Saux <lesaux@pythian.com>
# Install dependencies
ENV DEBIAN_FRONTEND noninteractive
ENV HANDLERS diamond.handler.graphite.GraphiteHandler
ENV GRAPHITE_HOST 127.0.0.1
ENV GRAPHITE_PORT 2003
ENV STATSD_HOST 127.0.0.1
ENV STATSD_PORT 8125
ENV DOCKER_HOSTNAME docker-hostname
ENV INTERVAL 5
RUN apt-get update && \
apt-get install -y python-setuptools make pbuilder python-mock python-configobj python-support cdbs git python-psutil python-pip && \
easy_install statsd && \
pip install diamond && \
sudo mkdir /usr/local/share/diamond/collectors/dockercontainer && \
find /usr/local/share/diamond/collectors/ -type f -name "*.py" -print0 | xargs -0 sed -i 's/\/proc/\/host_proc/g' && \
sudo pip install docker-py && \
apt-get autoremove -y git make pbuilder python-mock python-pip && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /Diamond /diamond-DockerContainerCollector /docker-py && \
rm -rf /etc/diamond
#add diamond config dir
ADD diamond /etc/diamond/
#add docker container collector
ADD dockercontainer.py /usr/local/share/diamond/collectors/dockercontainer/
#startup script
ADD config_diamond.sh /config_diamond.sh
RUN chmod +x /config_diamond.sh
ADD entrypoint.sh /
#start
ENTRYPOINT ["/entrypoint.sh"]