Merge pull request #176250 from aaronjheng/docker-slim

docker-slim: use buildGoModule
This commit is contained in:
Mario Rodas 2022-06-04 11:53:27 -05:00 committed by GitHub
commit df4b44a441
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,15 +1,9 @@
{ lib
, buildGoPackage
, fetchFromGitHub
, makeWrapper
}:
{ lib, buildGoModule, fetchFromGitHub, makeWrapper }:
buildGoPackage rec {
buildGoModule rec {
pname = "docker-slim";
version = "1.37.6";
goPackagePath = "github.com/docker-slim/docker-slim";
src = fetchFromGitHub {
owner = "docker-slim";
repo = "docker-slim";
@ -17,16 +11,17 @@ buildGoPackage rec {
sha256 = "sha256-Jzi6JC6DRklZhNqmFx6eHx6qR8/fb/JuSpgwtPThcc4=";
};
vendorSha256 = null;
subPackages = [ "cmd/docker-slim" "cmd/docker-slim-sensor" ];
nativeBuildInputs = [
makeWrapper
];
nativeBuildInputs = [ makeWrapper ];
ldflags = [
"-s" "-w"
"-X ${goPackagePath}/pkg/version.appVersionTag=${version}"
"-X ${goPackagePath}/pkg/version.appVersionRev=${src.rev}"
"-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}"
];
# docker-slim tries to create its state dir next to the binary (inside the nix