nixpkgs-suyu/pkgs/development/tools/dockle/default.nix

49 lines
1.2 KiB
Nix
Raw Normal View History

2021-02-12 16:07:16 +01:00
{ lib, buildGoModule, fetchFromGitHub, pkg-config, btrfs-progs, lvm2 }:
buildGoModule rec {
pname = "dockle";
2021-06-10 18:57:07 +02:00
version = "0.3.15";
2021-02-12 16:07:16 +01:00
src = fetchFromGitHub {
owner = "goodwithtech";
repo = pname;
rev = "v${version}";
2021-06-10 18:57:07 +02:00
sha256 = "sha256-jxFlbGJ95cSv08HcqrVufpTE5KkvAC9zOTQ2+JZWe5A=";
2021-02-12 16:07:16 +01:00
};
2021-06-09 06:23:38 +02:00
vendorSha256 = "sha256-h+2AcppNUJ7zjHeBzDy1iWoR3i7a2v0Pc7vOfoUqPOw=";
2021-02-12 16:07:16 +01:00
nativeBuildInputs = [ pkg-config ];
buildInputs = [ btrfs-progs lvm2 ];
2021-08-21 10:23:48 +02:00
ldflags = [
"-s" "-w" "-X main.version=${version}"
];
2021-02-12 16:07:16 +01:00
preCheck = ''
# Remove tests that use networking
2021-02-22 11:57:00 +01: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 16:07:16 +01: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 ];
};
}