-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
54 lines (42 loc) · 1.58 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
45
46
47
48
49
50
51
52
53
FROM ubuntu:16.04
ENV COLLECTD_VER 5.5.1-1build2
ENV CONFD_VER 0.12.0-alpha3
ENV EC2_METADATA_VER 2.1.2
ADD VERSION .
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update \
&& apt-get install -y \
--no-install-recommends \
libpython2.7 \
python-setuptools \
collectd=$COLLECTD_VER \
curl \
ca-certificates \
&& easy_install -U requests \
# Clean up packages
&& apt-get autoclean \
&& apt-get clean \
&& apt-get autoremove -y \
# Remove extraneous files
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /usr/share/man/* \
&& rm -rf /usr/share/info/* \
&& rm -rf /var/cache/man/* \
# Clean up tmp directory
&& rm -rf /tmp/* /var/tmp/*
ADD https://github.com/kelseyhightower/confd/releases/download/v$CONFD_VER/confd-$CONFD_VER-linux-amd64 /usr/local/bin/confd
ADD https://raw.githubusercontent.com/SungardAS/ec2-metadata/$EC2_METADATA_VER/ec2-metadata /usr/local/bin/ec2-metadata
ADD https://raw.githubusercontent.com/awslabs/collectd-cloudwatch/master/src/setup.py /tmp/setup.py
ADD /collectd-elasticsearch/elasticsearch_collectd.py /opt/collectd-plugins/
ADD /scripts/* /scripts/
ADD /templates/*.toml /etc/confd/conf.d/
ADD /templates/*.tmpl /etc/confd/templates/
RUN chmod +x /scripts/* \
&& chmod +x /usr/local/bin/ec2-metadata \
&& chmod +x /usr/local/bin/confd \
&& mv /scripts/ec2-metadata-value /usr/local/bin/ec2-metadata-value \
&& mkdir /etc/collectd/plugin-cfgs \
&& mkdir -p /opt/collectd-plugins/cloudwatch/config
WORKDIR /scripts
ENTRYPOINT ["/scripts/entry.sh"]
CMD ["run.sh"]