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:
- Install Go and Mercurial on the host machine—version 1.3 or higher of Go is needed to compile cAdvisor.
- Set the path for Go to work from.
- Grab the source code for cAdvisor and godep.
- Set the path for your Go binaries.
- Build the cAdvisor binary using godep to source the dependencies for us.
- Copy the binary to /
usr/local/bin/
. - Download either an
Upstart
orSystemd
script and launch the process.
If you followed the instructions in the previous section, you will already have a cAdvisor process running. Before compiling from source, you should start with a clean host; let's log out of the host and launch a fresh copy:
[vagrant@centos7 ~]$ exit logout Connection to 127.0.0.1 closed. [russ@mac ...