Merge pull request #254760 from raboof/docker-sbom-cli-plugin
docker-sbom: init at 0.6.1
This commit is contained in:
commit
831e3d73a5
@ -7,12 +7,13 @@ rec {
|
||||
, mobyRev, mobyHash
|
||||
, runcRev, runcHash
|
||||
, containerdRev, containerdHash
|
||||
, tiniRev, tiniHash, buildxSupport ? true, composeSupport ? true
|
||||
, tiniRev, tiniHash
|
||||
, buildxSupport ? true, composeSupport ? true, sbomSupport ? false
|
||||
# package dependencies
|
||||
, stdenv, fetchFromGitHub, fetchpatch, buildGoPackage
|
||||
, makeWrapper, installShellFiles, pkg-config, glibc
|
||||
, go-md2man, go, containerd, runc, docker-proxy, tini, libtool
|
||||
, sqlite, iproute2, docker-buildx, docker-compose
|
||||
, sqlite, iproute2, docker-buildx, docker-compose, docker-sbom
|
||||
, iptables, e2fsprogs, xz, util-linux, xfsprogs, git
|
||||
, procps, rootlesskit, slirp4netns, fuse-overlayfs, nixosTests
|
||||
, clientOnly ? !stdenv.isLinux, symlinkJoin
|
||||
@ -159,7 +160,8 @@ rec {
|
||||
});
|
||||
|
||||
plugins = lib.optional buildxSupport docker-buildx
|
||||
++ lib.optional composeSupport docker-compose;
|
||||
++ lib.optional composeSupport docker-compose
|
||||
++ lib.optional sbomSupport docker-sbom;
|
||||
pluginsRef = symlinkJoin { name = "docker-plugins"; paths = plugins; };
|
||||
in
|
||||
buildGoPackage (lib.optionalAttrs (!clientOnly) {
|
||||
|
@ -0,0 +1,28 @@
|
||||
diff --git a/test/cli/all_formats_expressible_test.go b/test/cli/all_formats_expressible_test.go
|
||||
index 3f40a46..5ba04e8 100644
|
||||
--- a/test/cli/all_formats_expressible_test.go
|
||||
+++ b/test/cli/all_formats_expressible_test.go
|
||||
@@ -8,7 +8,8 @@ import (
|
||||
"github.com/anchore/syft/syft"
|
||||
)
|
||||
|
||||
-func TestAllFormatsExpressible(t *testing.T) {
|
||||
+// Disabled because it needs a running docker daemon
|
||||
+func disabledTestAllFormatsExpressible(t *testing.T) {
|
||||
commonAssertions := []traitAssertion{
|
||||
func(tb testing.TB, stdout, _ string, _ int) {
|
||||
tb.Helper()
|
||||
diff --git a/test/cli/sbom_cmd_test.go b/test/cli/sbom_cmd_test.go
|
||||
index 0a0771c..a086c3b 100644
|
||||
--- a/test/cli/sbom_cmd_test.go
|
||||
+++ b/test/cli/sbom_cmd_test.go
|
||||
@@ -8,7 +8,8 @@ import (
|
||||
"github.com/docker/sbom-cli-plugin/internal"
|
||||
)
|
||||
|
||||
-func TestSBOMCmdFlags(t *testing.T) {
|
||||
+// Disabled because it needs a running docker daemon
|
||||
+func disabledTestSBOMCmdFlags(t *testing.T) {
|
||||
hiddenPackagesImage := getFixtureImage(t, "image-hidden-packages")
|
||||
coverageImage := getFixtureImage(t, "image-pkg-coverage")
|
||||
tmp := t.TempDir() + "/"
|
43
pkgs/applications/virtualization/docker/sbom.nix
Normal file
43
pkgs/applications/virtualization/docker/sbom.nix
Normal file
@ -0,0 +1,43 @@
|
||||
{ buildGoModule
|
||||
, fetchFromGitHub
|
||||
, docker
|
||||
, lib
|
||||
}:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "docker-sbom";
|
||||
version = "0.6.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "docker";
|
||||
repo = "sbom-cli-plugin";
|
||||
rev = "tags/v${version}";
|
||||
hash = "sha256-i3gIogHb0oW/VDuZUo6LGBmvqs/XfMXjpvTTYeGCK7Q=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# Disable tests that require a docker daemon to be running
|
||||
# in the sandbox
|
||||
./sbom-disable-tests.patch
|
||||
];
|
||||
|
||||
vendorHash = "sha256-XPPVAdY2NaasZ9bkf24VWWk3X5pjnryvsErYIWkeekc=";
|
||||
|
||||
nativeBuildInputs = [ docker ];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
install -D $GOPATH/bin/sbom-cli-plugin $out/libexec/docker/cli-plugins/docker-sbom
|
||||
|
||||
mkdir -p $out/bin
|
||||
ln -s $out/libexec/docker/cli-plugins/docker-sbom $out/bin/docker-sbom
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Plugin for Docker CLI to support SBOM creation using Syft";
|
||||
homepage = "https://github.com/docker/sbom-cli-plugin";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ raboof ];
|
||||
};
|
||||
}
|
@ -31379,6 +31379,8 @@ with pkgs;
|
||||
docker-buildx = callPackage ../applications/virtualization/docker/buildx.nix { };
|
||||
docker-compose = callPackage ../applications/virtualization/docker/compose.nix { };
|
||||
docker-compose_1 = python3Packages.callPackage ../applications/virtualization/docker/compose_1.nix { };
|
||||
docker-sbom = callPackage ../applications/virtualization/docker/sbom.nix { };
|
||||
|
||||
|
||||
amazon-ecr-credential-helper = callPackage ../tools/admin/amazon-ecr-credential-helper { };
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user