2018-07-21 01:44:44 +01:00
|
|
|
{ stdenv, go, fetchFromGitHub }:
|
2014-12-28 19:20:38 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "cadvisor";
|
2019-08-28 04:40:43 +01:00
|
|
|
version = "0.34.0";
|
2014-12-28 19:20:38 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "google";
|
|
|
|
repo = "cadvisor";
|
2016-09-15 13:28:12 +01:00
|
|
|
rev = "v${version}";
|
2019-08-28 04:40:43 +01:00
|
|
|
sha256 = "1hshmhsclja50ja2jqxx2f5lcvbs64n6aw6dw28wbnq3z9v0q8ad";
|
2014-12-28 19:20:38 +00:00
|
|
|
};
|
|
|
|
|
2018-01-27 10:10:56 +00:00
|
|
|
nativeBuildInputs = [ go ];
|
2014-12-28 19:20:38 +00:00
|
|
|
|
|
|
|
buildPhase = ''
|
2019-03-10 21:05:13 +00:00
|
|
|
export GOCACHE="$TMPDIR/go-cache"
|
2014-12-28 19:20:38 +00:00
|
|
|
mkdir -p Godeps/_workspace/src/github.com/google/
|
|
|
|
ln -s $(pwd) Godeps/_workspace/src/github.com/google/cadvisor
|
2019-08-28 04:40:43 +01:00
|
|
|
GOPATH=$(pwd)/Godeps/_workspace go build -v -o cadvisor -ldflags="-s -w -X github.com/google/cadvisor/version.Version=${version}" github.com/google/cadvisor
|
2014-12-28 19:20:38 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2019-08-28 04:40:43 +01:00
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
install -Dm755 -t $out/bin cadvisor
|
|
|
|
|
|
|
|
runHook postInstall
|
2014-12-28 19:20:38 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2015-04-28 09:54:58 +01:00
|
|
|
description = "Analyzes resource usage and performance characteristics of running docker containers";
|
2014-12-28 19:20:38 +00:00
|
|
|
homepage = https://github.com/google/cadvisor;
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ offline ];
|
2017-05-07 22:41:39 +01:00
|
|
|
platforms = platforms.linux;
|
2014-12-28 19:20:38 +00:00
|
|
|
};
|
|
|
|
}
|