commit
d60eea96a9
@ -1,32 +1,21 @@
|
|||||||
{ stdenv, go, fetchFromGitHub }:
|
{ stdenv, buildGoPackage, fetchFromGitHub }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
buildGoPackage rec {
|
||||||
pname = "cadvisor";
|
pname = "cadvisor";
|
||||||
version = "0.34.0";
|
version = "0.35.0";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "google";
|
owner = "google";
|
||||||
repo = "cadvisor";
|
repo = "cadvisor";
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
sha256 = "1hshmhsclja50ja2jqxx2f5lcvbs64n6aw6dw28wbnq3z9v0q8ad";
|
sha256 = "1652yf2a4ng9z0jq8q6jnzh6svj5nwar9j8q7sssgy36bi03ixqa";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ go ];
|
goPackagePath = "github.com/google/cadvisor";
|
||||||
|
|
||||||
buildPhase = ''
|
subPackages = [ "." ];
|
||||||
export GOCACHE="$TMPDIR/go-cache"
|
|
||||||
mkdir -p Godeps/_workspace/src/github.com/google/
|
|
||||||
ln -s $(pwd) Godeps/_workspace/src/github.com/google/cadvisor
|
|
||||||
GOPATH=$(pwd)/Godeps/_workspace go build -v -o cadvisor -ldflags="-s -w -X github.com/google/cadvisor/version.Version=${version}" github.com/google/cadvisor
|
|
||||||
'';
|
|
||||||
|
|
||||||
installPhase = ''
|
buildFlagsArray = [ "-ldflags=-s -w -X github.com/google/cadvisor/version.Version=${version}" ];
|
||||||
runHook preInstall
|
|
||||||
|
|
||||||
install -Dm755 -t $out/bin cadvisor
|
|
||||||
|
|
||||||
runHook postInstall
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "Analyzes resource usage and performance characteristics of running docker containers";
|
description = "Analyzes resource usage and performance characteristics of running docker containers";
|
||||||
|
Loading…
Reference in New Issue
Block a user