diff options
-rw-r--r-- | docker/barometer-collectd-experimental/Dockerfile | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/docker/barometer-collectd-experimental/Dockerfile b/docker/barometer-collectd-experimental/Dockerfile index 8622a63c..0a6d9806 100644 --- a/docker/barometer-collectd-experimental/Dockerfile +++ b/docker/barometer-collectd-experimental/Dockerfile @@ -14,7 +14,7 @@ # limitations under the License. # -FROM centos:8 +FROM centos:8 as builder ARG COLLECTD_FLAVOR=experimental ARG COLLECTD_PULL_REQUESTS @@ -30,11 +30,25 @@ COPY . ${repos_dir}/barometer WORKDIR ${repos_dir}/barometer/systems RUN ./build_base_machine.sh && \ - dnf clean all && rm -rf /var/cache/dnf && \ - useradd -ms /bin/bash collectd_exec && \ - echo "collectd_exec ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers + dnf clean all && rm -rf /var/cache/dnf + +FROM centos:8 COPY docker/barometer-collectd-experimental/run_collectd.sh /run_collectd.sh RUN chmod +x /run_collectd.sh +RUN useradd -ms /bin/bash collectd_exec && \ + echo "collectd_exec ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers + +COPY --from=builder /opt/collectd /opt/collectd +COPY --from=builder /usr/local/src /usr/local/src +COPY --from=builder /usr/share/snmp/mibs /usr/share/snmp/mibs +COPY --from=builder /opt/collectd/share/collectd/types.db /usr/share/collectd/types.db + +RUN dnf install -y 'dnf-command(builddep)' centos-release-opstools && \ + dnf config-manager --set-enabled powertools && \ + dnf builddep -y https://raw.githubusercontent.com/centos-opstools/collectd/master/collectd.spec && \ + dnf install -y jansson && \ + dnf clean all && rm -rf /var/cache/dnf + ENTRYPOINT ["/run_collectd.sh"] |