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