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