README 886 B

1234567891011121314151617181920
  1. We're going to use Docker to build a chroot env that can be run with systemd-nspawn since I cannot figure out how to run
  2. a container using docker in the global network namespace.
  3. 1. Build the collectd image using docker
  4. docker build -t collectd .
  5. 2. Run the container (since we have to run it to export it...)
  6. COLLECTD_CONTAINER=`docker run -name collectd-tmp -d collectd`
  7. 3. Export then kill the container
  8. docker export collectd-tmp > /tmp/collectd.tar
  9. 4. Kill the temporary container
  10. docker kill $COLLECTD_CONTAINER
  11. 5. Unpack the tar archive
  12. mkdir -p /tmp/collectd && tar -xvf /tmp/collectd.tar -C /tmp/collectd/
  13. 6. Run collectd with systemd-nspawn - replace the COLLECTD_* env vars with your parameters!
  14. sudo systemd-run --unit collectd systemd-nspawn -D /tmp/collectd /bin/bash -c "COLLECTD_GRAPHITE_HOSTNAME=172.31.13.241 COLLECTD_LOCAL_HOSTNAME=node1 /bin/collectd-wrapper"