grype
Scan a container image using Grype
Installation
dagger install github.com/opopops/daggerverse/grype@v1.3.0Entrypoint
Return Type
Grype !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| image | String ! | "cgr.dev/chainguard/wolfi-base:latest" | Grype image |
| registryUsername | String | null | No description provided |
| registryPassword | Secret | null | No description provided |
| user | String ! | "nonroot" | Image user |
| container | Container | null | No description provided |
Example
dagger -m github.com/opopops/daggerverse/grype@f49bc68cb1f05c494bdd30abb8aa019b834da1b5 call \
--image string --user stringfunc (m *MyModule) Example(image string, user string) *dagger.Grype {
return dag.
Grype(image, user)
}@function
def example(image: str, user: str, ) -> dagger.Grype:
return (
dag.grype(image, user)
)@func()
example(image: string, user: string, ): Grype {
return dag
.grype(image, user)
}Types
Grype 🔗
Grype CLI
image() 🔗
Grype image
Return Type
String ! Example
dagger -m github.com/opopops/daggerverse/grype@f49bc68cb1f05c494bdd30abb8aa019b834da1b5 call \
--image string --user string imagefunc (m *MyModule) Example(ctx context.Context, image string, user string) string {
return dag.
Grype(image, user).
Image(ctx)
}@function
async def example(image: str, user: str, ) -> str:
return await (
dag.grype(image, user)
.image()
)@func()
async example(image: string, user: string, ): Promise<string> {
return dag
.grype(image, user)
.image()
}registryUsername() 🔗
Return Type
String Example
dagger -m github.com/opopops/daggerverse/grype@f49bc68cb1f05c494bdd30abb8aa019b834da1b5 call \
--image string --user string registry-usernamefunc (m *MyModule) Example(ctx context.Context, image string, user string) string {
return dag.
Grype(image, user).
RegistryUsername(ctx)
}@function
async def example(image: str, user: str, ) -> str:
return await (
dag.grype(image, user)
.registry_username()
)@func()
async example(image: string, user: string, ): Promise<string> {
return dag
.grype(image, user)
.registryUsername()
}registryPassword() 🔗
Return Type
Secret Example
dagger -m github.com/opopops/daggerverse/grype@f49bc68cb1f05c494bdd30abb8aa019b834da1b5 call \
--image string --user string registry-passwordfunc (m *MyModule) Example(image string, user string) *dagger.Secret {
return dag.
Grype(image, user).
RegistryPassword()
}@function
def example(image: str, user: str, ) -> dagger.Secret:
return (
dag.grype(image, user)
.registry_password()
)@func()
example(image: string, user: string, ): Secret {
return dag
.grype(image, user)
.registryPassword()
}user() 🔗
Image user
Return Type
String ! Example
dagger -m github.com/opopops/daggerverse/grype@f49bc68cb1f05c494bdd30abb8aa019b834da1b5 call \
--image string --user string userfunc (m *MyModule) Example(ctx context.Context, image string, user string) string {
return dag.
Grype(image, user).
User(ctx)
}@function
async def example(image: str, user: str, ) -> str:
return await (
dag.grype(image, user)
.user()
)@func()
async example(image: string, user: string, ): Promise<string> {
return dag
.grype(image, user)
.user()
}container() 🔗
Returns configured grype container
Return Type
Container ! Example
dagger -m github.com/opopops/daggerverse/grype@f49bc68cb1f05c494bdd30abb8aa019b834da1b5 call \
--image string --user string containerfunc (m *MyModule) Example(image string, user string) *dagger.Container {
return dag.
Grype(image, user).
Container()
}@function
def example(image: str, user: str, ) -> dagger.Container:
return (
dag.grype(image, user)
.container()
)@func()
example(image: string, user: string, ): Container {
return dag
.grype(image, user)
.container()
}scan() 🔗
Scan
Return Type
File !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | String ! | - | Source to scan |
| failOn | String | null | No description provided |
| outputFormat | String ! | "sarif" | Report output formatter |
Example
dagger -m github.com/opopops/daggerverse/grype@f49bc68cb1f05c494bdd30abb8aa019b834da1b5 call \
--image string --user string scan --source string --output-format stringfunc (m *MyModule) Example(image string, user string, source string, outputFormat string) *dagger.File {
return dag.
Grype(image, user).
Scan(source, outputFormat)
}@function
def example(image: str, user: str, source: str, output_format: str) -> dagger.File:
return (
dag.grype(image, user)
.scan(source, output_format)
)@func()
example(image: string, user: string, source: string, outputFormat: string): File {
return dag
.grype(image, user)
.scan(source, outputFormat)
}scanDirectory() 🔗
Scan directory
Return Type
File !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | Directory to scan |
| scheme | String | "dir" | No description provided |
| failOn | String | null | No description provided |
| outputFormat | String ! | "sarif" | Report output formatter |
Example
dagger -m github.com/opopops/daggerverse/grype@f49bc68cb1f05c494bdd30abb8aa019b834da1b5 call \
--image string --user string scan-directory --source DIR_PATH --output-format stringfunc (m *MyModule) Example(image string, user string, source *dagger.Directory, outputFormat string) *dagger.File {
return dag.
Grype(image, user).
ScanDirectory(source, outputFormat)
}@function
def example(image: str, user: str, source: dagger.Directory, output_format: str) -> dagger.File:
return (
dag.grype(image, user)
.scan_directory(source, output_format)
)@func()
example(image: string, user: string, source: Directory, outputFormat: string): File {
return dag
.grype(image, user)
.scanDirectory(source, outputFormat)
}scanFile() 🔗
Scan file
Return Type
File !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | File ! | - | File to scan |
| scheme | String | "file" | No description provided |
| failOn | String | null | No description provided |
| outputFormat | String ! | "sarif" | Report output formatter |
Example
dagger -m github.com/opopops/daggerverse/grype@f49bc68cb1f05c494bdd30abb8aa019b834da1b5 call \
--image string --user string scan-file --source file:path --output-format stringfunc (m *MyModule) Example(image string, user string, source *dagger.File, outputFormat string) *dagger.File {
return dag.
Grype(image, user).
ScanFile(source, outputFormat)
}@function
def example(image: str, user: str, source: dagger.File, output_format: str) -> dagger.File:
return (
dag.grype(image, user)
.scan_file(source, output_format)
)@func()
example(image: string, user: string, source: File, outputFormat: string): File {
return dag
.grype(image, user)
.scanFile(source, outputFormat)
}scanImage() 🔗
Scan container image
Return Type
File !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | String ! | - | Image to scan |
| scheme | String | "registry" | No description provided |
| failOn | String | null | No description provided |
| outputFormat | String ! | "sarif" | Report output formatter |
Example
dagger -m github.com/opopops/daggerverse/grype@f49bc68cb1f05c494bdd30abb8aa019b834da1b5 call \
--image string --user string scan-image --source string --output-format stringfunc (m *MyModule) Example(image string, user string, source string, outputFormat string) *dagger.File {
return dag.
Grype(image, user).
ScanImage(source, outputFormat)
}@function
def example(image: str, user: str, source: str, output_format: str) -> dagger.File:
return (
dag.grype(image, user)
.scan_image(source, output_format)
)@func()
example(image: string, user: string, source: string, outputFormat: string): File {
return dag
.grype(image, user)
.scanImage(source, outputFormat)
}withRegistryAuth() 🔗
Authenticate with registry
Return Type
Grype !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| username | String ! | - | Registry username |
| secret | Secret ! | - | Registry password |
| address | String | "docker.io" | No description provided |
Example
dagger -m github.com/opopops/daggerverse/grype@f49bc68cb1f05c494bdd30abb8aa019b834da1b5 call \
--image string --user string with-registry-auth --username string --secret env:MYSECRETfunc (m *MyModule) Example(image string, user string, username string, secret *dagger.Secret) *dagger.Grype {
return dag.
Grype(image, user).
WithRegistryAuth(username, secret)
}@function
def example(image: str, user: str, username: str, secret: dagger.Secret) -> dagger.Grype:
return (
dag.grype(image, user)
.with_registry_auth(username, secret)
)@func()
example(image: string, user: string, username: string, secret: Secret): Grype {
return dag
.grype(image, user)
.withRegistryAuth(username, secret)
}withScan() 🔗
Scan (for chaining)
Return Type
Grype !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | String ! | - | Source to scan |
| failOn | String | null | No description provided |
| outputFormat | String ! | "sarif" | Report output formatter |
Example
dagger -m github.com/opopops/daggerverse/grype@f49bc68cb1f05c494bdd30abb8aa019b834da1b5 call \
--image string --user string with-scan --source string --output-format stringfunc (m *MyModule) Example(image string, user string, source string, outputFormat string) *dagger.Grype {
return dag.
Grype(image, user).
WithScan(source, outputFormat)
}@function
def example(image: str, user: str, source: str, output_format: str) -> dagger.Grype:
return (
dag.grype(image, user)
.with_scan(source, output_format)
)@func()
example(image: string, user: string, source: string, outputFormat: string): Grype {
return dag
.grype(image, user)
.withScan(source, outputFormat)
}withScanDirectory() 🔗
Scan dir (for chaining)
Return Type
Grype !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | Directory to scan |
| scheme | String | "registry" | No description provided |
| failOn | String | null | No description provided |
| outputFormat | String ! | "sarif" | Report output formatter |
Example
dagger -m github.com/opopops/daggerverse/grype@f49bc68cb1f05c494bdd30abb8aa019b834da1b5 call \
--image string --user string with-scan-directory --source DIR_PATH --output-format stringfunc (m *MyModule) Example(image string, user string, source *dagger.Directory, outputFormat string) *dagger.Grype {
return dag.
Grype(image, user).
WithScanDirectory(source, outputFormat)
}@function
def example(image: str, user: str, source: dagger.Directory, output_format: str) -> dagger.Grype:
return (
dag.grype(image, user)
.with_scan_directory(source, output_format)
)@func()
example(image: string, user: string, source: Directory, outputFormat: string): Grype {
return dag
.grype(image, user)
.withScanDirectory(source, outputFormat)
}withScanFile() 🔗
Scan file (for chaining)
Return Type
Grype !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | File ! | - | File to scan |
| scheme | String | "registry" | No description provided |
| failOn | String | null | No description provided |
| outputFormat | String ! | "sarif" | Report output formatter |
Example
dagger -m github.com/opopops/daggerverse/grype@f49bc68cb1f05c494bdd30abb8aa019b834da1b5 call \
--image string --user string with-scan-file --source file:path --output-format stringfunc (m *MyModule) Example(image string, user string, source *dagger.File, outputFormat string) *dagger.Grype {
return dag.
Grype(image, user).
WithScanFile(source, outputFormat)
}@function
def example(image: str, user: str, source: dagger.File, output_format: str) -> dagger.Grype:
return (
dag.grype(image, user)
.with_scan_file(source, output_format)
)@func()
example(image: string, user: string, source: File, outputFormat: string): Grype {
return dag
.grype(image, user)
.withScanFile(source, outputFormat)
}withScanImage() 🔗
Scan container image (for chaining)
Return Type
Grype !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | String ! | - | Image to scan |
| scheme | String | "registry" | No description provided |
| failOn | String | null | No description provided |
| outputFormat | String ! | "sarif" | Report output formatter |
Example
dagger -m github.com/opopops/daggerverse/grype@f49bc68cb1f05c494bdd30abb8aa019b834da1b5 call \
--image string --user string with-scan-image --source string --output-format stringfunc (m *MyModule) Example(image string, user string, source string, outputFormat string) *dagger.Grype {
return dag.
Grype(image, user).
WithScanImage(source, outputFormat)
}@function
def example(image: str, user: str, source: str, output_format: str) -> dagger.Grype:
return (
dag.grype(image, user)
.with_scan_image(source, output_format)
)@func()
example(image: string, user: string, source: string, outputFormat: string): Grype {
return dag
.grype(image, user)
.withScanImage(source, outputFormat)
}