2022-06-16 17:23:12 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, makeWrapper }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
buildGoModule rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "docker-slim";
|
2022-10-30 15:09:59 +00:00
|
|
|
version = "1.39.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "docker-slim";
|
|
|
|
repo = "docker-slim";
|
|
|
|
rev = version;
|
2022-10-30 15:09:59 +00:00
|
|
|
sha256 = "sha256-CN3mvXjI6c10yvXM2owWASngsU2PjgLhd1N55vxubw0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
vendorSha256 = null;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
subPackages = [ "cmd/docker-slim" "cmd/docker-slim-sensor" ];
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-27 14:25:00 +00:00
|
|
|
ldflags = [
|
2022-06-16 17:23:12 +00:00
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X github.com/docker-slim/docker-slim/pkg/version.appVersionTag=${version}"
|
|
|
|
"-X github.com/docker-slim/docker-slim/pkg/version.appVersionRev=${src.rev}"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# docker-slim tries to create its state dir next to the binary (inside the nix
|
|
|
|
# store), so we set it to use the working directory at the time of invocation
|
|
|
|
postInstall = ''
|
2020-05-15 21:57:56 +00:00
|
|
|
wrapProgram "$out/bin/docker-slim" --add-flags '--state-path "$(pwd)"'
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Minify and secure Docker containers";
|
|
|
|
homepage = "https://dockersl.im/";
|
2021-09-18 10:52:07 +00:00
|
|
|
changelog = "https://github.com/docker-slim/docker-slim/raw/${version}/CHANGELOG.md";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
2020-11-19 00:13:47 +00:00
|
|
|
maintainers = with maintainers; [ Br1ght0ne marsam mbrgm ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|