contrib/docker: add basic Dockerfile & config files
authorMarc Fournier <marc.fournier@camptocamp.com>
Wed, 12 Oct 2016 05:14:20 +0000 (07:14 +0200)
committerMarc Fournier <marc.fournier@camptocamp.com>
Wed, 16 Nov 2016 07:02:05 +0000 (08:02 +0100)
contrib/docker/50docker-apt-conf [new file with mode: 0644]
contrib/docker/Dockerfile [new file with mode: 0644]
contrib/docker/collectd.conf [new file with mode: 0644]

diff --git a/contrib/docker/50docker-apt-conf b/contrib/docker/50docker-apt-conf
new file mode 100644 (file)
index 0000000..3f898b3
--- /dev/null
@@ -0,0 +1,4 @@
+APT::Install-Recommends "0";
+APT::Install-Suggests "0";
+APT::Get::Assume-Yes "1";
+APT::Get::AutomaticRemove "1";
diff --git a/contrib/docker/Dockerfile b/contrib/docker/Dockerfile
new file mode 100644 (file)
index 0000000..ff0a0d5
--- /dev/null
@@ -0,0 +1,24 @@
+FROM debian:stable
+
+ENV DEBIAN_FRONTEND noninteractive
+COPY 50docker-apt-conf /etc/apt/apt.conf.d/
+
+COPY rootfs_prefix/ /usr/src/rootfs_prefix/
+
+RUN apt-get update \
+ && apt-get upgrade \
+ && apt-get install \
+    collectd-core \
+    collectd-utils \
+    build-essential \
+ && make -C /usr/src/rootfs_prefix/ \
+ && apt-get --purge remove build-essential \
+ && apt-get clean \
+ && rm -rf /var/lib/apt/lists/*
+
+RUN mkdir /etc/collectd/collectd.conf.d
+COPY collectd.conf /etc/collectd/collectd.conf
+
+ENV LD_PRELOAD /usr/src/rootfs_prefix/rootfs_prefix.so
+
+CMD [ "/usr/sbin/collectd", "-f"]
diff --git a/contrib/docker/collectd.conf b/contrib/docker/collectd.conf
new file mode 100644 (file)
index 0000000..bbcd079
--- /dev/null
@@ -0,0 +1,16 @@
+LoadPlugin logfile
+<Plugin logfile>
+       LogLevel "info"
+       File STDOUT
+       Timestamp true
+       PrintSeverity true
+</Plugin>
+
+LoadPlugin unixsock
+<Plugin unixsock>
+        SocketGroup "nogroup"
+</Plugin>
+
+<Include "/etc/collectd/collectd.conf.d">
+        Filter "*.conf"
+</Include>