diff --git a/Dockerfile b/Dockerfile index 8367f9a..1eb0d0a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,75 +1,19 @@ FROM debian:jessie -MAINTAINER Carles Amigó, fr3nd@fr3nd.net +ENV COLLECTD_VERSION 5.5.0 +WORKDIR /usr/src/ -RUN apt-get update && apt-get install -y \ - autoconf \ - automake \ - autotools-dev \ - bison \ - build-essential \ - curl \ - flex \ - git \ - iptables-dev \ - libcurl4-gnutls-dev \ - libdbi0-dev \ - libesmtp-dev \ - libganglia1-dev \ - libgcrypt11-dev \ - libglib2.0-dev \ - libhiredis-dev \ - libltdl-dev \ - liblvm2-dev \ - libmemcached-dev \ - libmnl-dev \ - libmodbus-dev \ - libmysqlclient-dev \ - libopenipmi-dev \ - liboping-dev \ - libow-dev \ - libpcap-dev \ - libperl-dev \ - libpq-dev \ - libprotobuf-c-dev \ - librabbitmq-dev \ - librrd-dev \ - libsensors4-dev \ - libsnmp-dev \ - libtokyocabinet-dev \ - libtokyotyrant-dev \ - libtool \ - libupsclient-dev \ - libvirt-dev \ - libxml2-dev \ - libyajl-dev \ - linux-libc-dev \ - pkg-config \ - protobuf-c-compiler \ - python-dev && \ - rm -rf /usr/share/doc/* && \ - rm -rf /usr/share/info/* && \ - rm -rf /tmp/* && \ - rm -rf /var/tmp/* - -ENV COLLECTD_VERSION collectd-5.5.0 - -WORKDIR /usr/src -RUN git clone https://github.com/collectd/collectd.git -WORKDIR /usr/src/collectd -RUN git checkout $COLLECTD_VERSION -RUN ./build.sh -RUN ./configure \ - --prefix=/usr \ - --sysconfdir=/etc/collectd \ - --without-libstatgrab \ - --without-included-ltdl \ - --disable-static -RUN make all -RUN make install -RUN make clean ADD collectd.conf /etc/collectd/ ADD entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh + +RUN echo 'ef97838e249814ad96a2edc0410326efbb4f3d08 collectd-5.5.0.tar.bz2' > /tmp/collectd.sig && \ + apt-get update && apt-get install -y build-essential wget tar lbzip2 && \ + wget https://collectd.org/files/collectd-$COLLECTD_VERSION.tar.bz2 && \ + shasum -a 1 -c /tmp/collectd.sig && \ + tar xf collectd-$COLLECTD_VERSION.tar.bz2 && \ + cd collectd-$COLLECTD_VERSION && \ + ./configure && make && make install && cd - \ + rm -rf /usr/src/collectd /usr/src/collectd-$COLLECTD_VERSION* /var/lib/apt/lists/* && \ + apt-get autoremove -y build-essential ENTRYPOINT ["/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh index 196c252..1aa88e5 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -8,7 +8,7 @@ if [ -d /mnt/proc ]; then fi if [ -z "$@" ]; then - exec /usr/sbin/collectd -C /etc/collectd/collectd.conf -f + exec /opt/collectd/sbin/collectd -C /etc/collectd/collectd.conf -f else exec $@ fi