1{ lib, buildGoModule, fetchFromGitHub, pkg-config, btrfs-progs, lvm2 }:
2
3buildGoModule rec {
4 pname = "dockle";
5 version = "0.4.5";
6
7 src = fetchFromGitHub {
8 owner = "goodwithtech";
9 repo = pname;
10 rev = "v${version}";
11 sha256 = "sha256-QC0WAM+qitee0dyJorl5Hio3COy4JiIHmFgBIj7S2yM=";
12 };
13
14 vendorSha256 = "sha256-9n/782uKu7qNV/WEpbEV3aHcPXipyOhGdAhT/F4O2xc=";
15
16 nativeBuildInputs = [ pkg-config ];
17 buildInputs = [ btrfs-progs lvm2 ];
18
19 ldflags = [
20 "-s" "-w" "-X main.version=${version}"
21 ];
22
23 preCheck = ''
24 # Remove tests that use networking
25 rm pkg/scanner/scan_test.go
26 '';
27
28 doInstallCheck = true;
29 installCheckPhase = ''
30 runHook preInstallCheck
31 $out/bin/dockle --help
32 $out/bin/dockle --version | grep "dockle version ${version}"
33 runHook postInstallCheck
34 '';
35
36 meta = with lib; {
37 homepage = "https://containers.goodwith.tech";
38 changelog = "https://github.com/goodwithtech/dockle/releases/tag/v${version}";
39 description = "Container Image Linter for Security";
40 longDescription = ''
41 Container Image Linter for Security.
42 Helping build the Best-Practice Docker Image.
43 Easy to start.
44 '';
45 license = licenses.asl20;
46 maintainers = with maintainers; [ jk ];
47 };
48}