diff options
author | Emma Foley <efoley@redhat.com> | 2021-07-08 10:50:02 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2021-07-08 10:50:02 +0000 |
commit | 283d8a7c2a4d193ef059f993140e0075c6494ac1 (patch) | |
tree | 3f15166e83a55ed418a0ab1e8d387a56fbfbdaae /docker | |
parent | 9a9a470cd1033dbbf8adb1dcc93bc881e131a1ab (diff) | |
parent | 7a731e7183eec2a242f28e6686ffe41250b8e5d6 (diff) |
Merge "[docker][experimental] Split the build"
Diffstat (limited to 'docker')
-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"] |