2021-02-12 15:07:16 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, pkg-config, btrfs-progs, lvm2 }:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "dockle";
|
2022-02-18 05:33:43 +00:00
|
|
|
version = "0.4.4";
|
2021-02-12 15:07:16 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "goodwithtech";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-02-18 05:33:43 +00:00
|
|
|
sha256 = "sha256-lXX266wVvAebUaYsoANuNAyguh7F1OUPPNrSqQSINuU=";
|
2021-02-12 15:07:16 +00:00
|
|
|
};
|
|
|
|
|
2022-02-18 05:33:43 +00:00
|
|
|
vendorSha256 = "sha256-4yluXfk84vJFSvz9PCSym0Vxx1glyvVZWZy2kdqk/a4=";
|
2021-02-12 15:07:16 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ pkg-config ];
|
|
|
|
buildInputs = [ btrfs-progs lvm2 ];
|
|
|
|
|
2021-08-21 09:23:48 +01:00
|
|
|
ldflags = [
|
|
|
|
"-s" "-w" "-X main.version=${version}"
|
|
|
|
];
|
2021-02-12 15:07:16 +00:00
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
# Remove tests that use networking
|
2021-02-22 10:57:00 +00:00
|
|
|
rm pkg/scanner/scan_test.go
|
|
|
|
'';
|
|
|
|
|
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
|
|
runHook preInstallCheck
|
|
|
|
$out/bin/dockle --help
|
|
|
|
$out/bin/dockle --version | grep "dockle version ${version}"
|
|
|
|
runHook postInstallCheck
|
2021-02-12 15:07:16 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://containers.goodwith.tech";
|
|
|
|
changelog = "https://github.com/goodwithtech/dockle/releases/tag/v${version}";
|
|
|
|
description = "Container Image Linter for Security";
|
|
|
|
longDescription = ''
|
|
|
|
Container Image Linter for Security.
|
|
|
|
Helping build the Best-Practice Docker Image.
|
|
|
|
Easy to start.
|
|
|
|
'';
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ jk ];
|
|
|
|
};
|
|
|
|
}
|