syft
it into a release container (where goreleaser drives it), and a standaloneSbom that scans a directory. It pins the syft version in one place.
Installation
dagger install github.com/MacroPower/x/toolchains/syft@483dc69c30e485db85d928723096efa22c3603c6Entrypoint
Return Type
Syft !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| image | String | - | syft container image. |
Example
dagger -m github.com/MacroPower/x/toolchains/syft@483dc69c30e485db85d928723096efa22c3603c6 call \
func (m *MyModule) Example() *dagger.Syft {
return dag.
Syft()
}@function
def example() -> dagger.Syft:
return (
dag.syft()
)@func()
example(): Syft {
return dag
.syft()
}Types
Syft 🔗
Syft provides the syft SBOM generator. Create instances with [New].
image() 🔗
syft container image reference.
Return Type
String ! Example
dagger -m github.com/MacroPower/x/toolchains/syft@483dc69c30e485db85d928723096efa22c3603c6 call \
imagefunc (m *MyModule) Example(ctx context.Context) string {
return dag.
Syft().
Image(ctx)
}@function
async def example() -> str:
return await (
dag.syft()
.image()
)@func()
async example(): Promise<string> {
return dag
.syft()
.image()
}binary() 🔗
Binary returns the syft executable, extracted from the official image so it can be layered onto another container (e.g. a goreleaser release base).
Return Type
File ! Example
dagger -m github.com/MacroPower/x/toolchains/syft@483dc69c30e485db85d928723096efa22c3603c6 call \
binaryfunc (m *MyModule) Example() *dagger.File {
return dag.
Syft().
Binary()
}@function
def example() -> dagger.File:
return (
dag.syft()
.binary()
)@func()
example(): File {
return dag
.syft()
.binary()
}sbom() 🔗
Sbom scans a source directory and returns its SBOM in the given format (a syft output format such as “spdx-json”, “cyclonedx-json”, “syft-json”).
Return Type
File !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | Directory to scan. |
| format | String | "spdx-json" | syft output format. |
Example
dagger -m github.com/MacroPower/x/toolchains/syft@483dc69c30e485db85d928723096efa22c3603c6 call \
sbom --source DIR_PATHfunc (m *MyModule) Example(source *dagger.Directory) *dagger.File {
return dag.
Syft().
Sbom(source)
}@function
def example(source: dagger.Directory) -> dagger.File:
return (
dag.syft()
.sbom(source)
)@func()
example(source: Directory): File {
return dag
.syft()
.sbom(source)
}withSyft() 🔗
WithSyft installs the syft binary at /usr/local/bin/syft in the given container, for tools (like goreleaser’s sbom step) that invoke it.
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| ctr | Container ! | - | Container to install syft into. |
Example
dagger -m github.com/MacroPower/x/toolchains/syft@483dc69c30e485db85d928723096efa22c3603c6 call \
with-syft --ctr IMAGE:TAGfunc (m *MyModule) Example(ctr *dagger.Container) *dagger.Container {
return dag.
Syft().
WithSyft(ctr)
}@function
def example(ctr: dagger.Container) -> dagger.Container:
return (
dag.syft()
.with_syft(ctr)
)@func()
example(ctr: Container): Container {
return dag
.syft()
.withSyft(ctr)
}