Compiling cAdvisor from source

As mentioned in the previous section, cAdvisor really ought to be executed on the host machine; this means, you may have to use a case to compile your own cAdvisor binary and run it directly on the host.

To compile cAdvisor, you will need to perform the following steps:

  1. Install Go and Mercurial on the host machine—version 1.3 or higher of Go is needed to compile cAdvisor.
  2. Set the path for Go to work from.
  3. Grab the source code for cAdvisor and godep.
  4. Set the path for your Go binaries.
  5. Build the cAdvisor binary using godep to source the dependencies for us.
  6. Copy the binary to /usr/local/bin/.
  7. Download either an Upstart or Systemd script and launch the process.

If you followed the instructions in the previous section, you will ...

Get Monitoring Docker now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.