github.com/ghodss/etcd@v0.3.1-0.20140417172404-cc329bfa55cb/contrib/collectd/README (about)

     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  
     4  1. Build the collectd image using docker
     5  docker build -t collectd .
     6  
     7  2. Run the container (since we have to run it to export it...)
     8  COLLECTD_CONTAINER=`docker run -name collectd-tmp -d collectd`
     9  
    10  3. Export then kill the container
    11  docker export collectd-tmp > /tmp/collectd.tar
    12  
    13  4. Kill the temporary container
    14  docker kill $COLLECTD_CONTAINER
    15  
    16  5. Unpack the tar archive
    17  mkdir -p /tmp/collectd && tar -xvf /tmp/collectd.tar -C /tmp/collectd/
    18  
    19  6. Run collectd with systemd-nspawn - replace the COLLECTD_* env vars with your parameters!
    20  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"