Skip to content

Latest commit

 

History

History
55 lines (34 loc) · 1.53 KB

build.md

File metadata and controls

55 lines (34 loc) · 1.53 KB

Building and Testing cAdvisor

Note: cAdvisor only builds on Linux since it uses Linux-only APIs.

Installing Dependencies

cAdvisor is written in the Go programming language. If you haven't set up a Go development environment, please follow these instructions to install go tool and set up GOPATH. Ensure that your version of Go is at least 1.3. Note that the version of Go in package repositories of some operating systems is outdated, so please download the latest version.

Note: cAdvisor requires Go 1.5 to build.

After setting up Go, you should be able to go get cAdvisor as expected (we use -d to only download):

$ go get -d github.com/google/cadvisor

We use godep so you will need to get that as well:

$ go get github.com/tools/godep

Building from Source

At this point you can build cAdvisor from the source folder:

$GOPATH/src/github.com/google/cadvisor $ godep go build .

or run only unit tests:

$GOPATH/src/github.com/google/cadvisor $ godep go test ./... -test.short

For integration tests, see the integration testing page.

Running Built Binary

Now you can run the built binary:

$GOPATH/src/github.com/google/cadvisor $ sudo ./cadvisor

Compiling Assets

If you modify files in the /assets folder, you will need to rebuild the assets:

$GOPATH/src/github.com/google/cadvisor $ ./build/assets.sh
$GOPATH/src/github.com/google/cadvisor $ godep go build .