wolfi
This module has been generated via dagger init and serves as a reference tobasic module structure as you get started with Dagger.
Two functions have been pre-created. You can modify, delete, or add to them,
as needed. They demonstrate usage of arguments and return types using simple
echo and grep commands. The functions can be called from the dagger CLI or
from one of the SDKs.
The first line in this comment block is a short description line and the
rest is a long description with more detail on the module's purpose or usage,
if appropriate. All modules should have a short description.
Installation
dagger install github.com/opopops/wolfi@c65ab999b4087d507052c855550b81ebd6cc90a5
Entrypoint
Return Type
Wolfi !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
source | Directory | - | Source directory |
githubActions | Boolean | false | Enable GitHub Actions |
githubActor | String | "" | GitHub Actor |
githubRepository | String | "" | The owner and repository name |
githubRepositoryOwner | String | "" | The repository owner's username |
githubToken | Secret | null | GitHub Token |
githubOidcProviderToken | Secret | null | GitHub OIDC provider Token |
githubOidcProviderUrl | Secret | null | GitHub OIDC provider URL |
Example
dagger -m github.com/opopops/wolfi@c65ab999b4087d507052c855550b81ebd6cc90a5 call \
func (m *MyModule) Example() *dagger.Wolfi {
return dag.
Wolfi()
}
@function
def example() -> dagger.Wolfi:
return (
dag.wolfi()
)
@func()
example(): Wolfi {
return dag
.wolfi()
}
Types
Wolfi 🔗
Build Wolfi base images
apko() 🔗
Return the apko container
Return Type
Container !
Example
dagger -m github.com/opopops/wolfi@c65ab999b4087d507052c855550b81ebd6cc90a5 call \
apko
func (m *MyModule) Example() *dagger.Container {
return dag.
Wolfi().
Apko()
}
@function
def example() -> dagger.Container:
return (
dag.wolfi()
.apko()
)
@func()
example(): Container {
return dag
.wolfi()
.apko()
}
build() 🔗
Build an image from a YAML config file and returns it as a directory
Return Type
Directory !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
image | String ! | - | Image name |
variant | String | "prod" | Image variant |
platform | [Scalar ! ] | null | Platforms |
Example
dagger -m github.com/opopops/wolfi@c65ab999b4087d507052c855550b81ebd6cc90a5 call \
build --image string
func (m *MyModule) Example(image string) *dagger.Directory {
return dag.
Wolfi().
Build(image)
}
@function
def example(image: str) -> dagger.Directory:
return (
dag.wolfi()
.build(image)
)
@func()
example(image: string): Directory {
return dag
.wolfi()
.build(image)
}
config() 🔗
Return the Apko config derived from loading a YAML file
Return Type
File !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
config | File ! | - | A file. |
Example
dagger -m github.com/opopops/wolfi@c65ab999b4087d507052c855550b81ebd6cc90a5 call \
config --config file:path
func (m *MyModule) Example(config *dagger.File) *dagger.File {
return dag.
Wolfi().
Config(config)
}
@function
def example(config: dagger.File) -> dagger.File:
return (
dag.wolfi()
.config(config)
)
@func()
example(config: File): File {
return dag
.wolfi()
.config(config)
}
container() 🔗
Return the image container built from a YAML config file
Return Type
Container !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
image | String ! | - | Image name |
variant | String | "prod" | Image variant |
Example
dagger -m github.com/opopops/wolfi@c65ab999b4087d507052c855550b81ebd6cc90a5 call \
container --image string
func (m *MyModule) Example(image string) *dagger.Container {
return dag.
Wolfi().
Container(image)
}
@function
def example(image: str) -> dagger.Container:
return (
dag.wolfi()
.container(image)
)
@func()
example(image: string): Container {
return dag
.wolfi()
.container(image)
}
cosign() 🔗
Return the cosign container
Return Type
Container !
Example
dagger -m github.com/opopops/wolfi@c65ab999b4087d507052c855550b81ebd6cc90a5 call \
cosign
func (m *MyModule) Example() *dagger.Container {
return dag.
Wolfi().
Cosign()
}
@function
def example() -> dagger.Container:
return (
dag.wolfi()
.cosign()
)
@func()
example(): Container {
return dag
.wolfi()
.cosign()
}
crane() 🔗
Return the crane container
Return Type
Container !
Example
dagger -m github.com/opopops/wolfi@c65ab999b4087d507052c855550b81ebd6cc90a5 call \
crane
func (m *MyModule) Example() *dagger.Container {
return dag.
Wolfi().
Crane()
}
@function
def example() -> dagger.Container:
return (
dag.wolfi()
.crane()
)
@func()
example(): Container {
return dag
.wolfi()
.crane()
}
grype() 🔗
Return the grype container
Return Type
Container !
Example
dagger -m github.com/opopops/wolfi@c65ab999b4087d507052c855550b81ebd6cc90a5 call \
grype
func (m *MyModule) Example() *dagger.Container {
return dag.
Wolfi().
Grype()
}
@function
def example() -> dagger.Container:
return (
dag.wolfi()
.grype()
)
@func()
example(): Container {
return dag
.wolfi()
.grype()
}
publish() 🔗
Publish an image from a YAML config file
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
image | String ! | - | Image name |
variant | String | "prod" | Image variant |
tag | [String ! ] ! | [] | Image tags |
version | String ! | "" | Image version. Used when no tags provided |
platform | [Scalar ! ] | null | Platforms |
scan | Boolean ! | true | Scan the image for vulnerabilities |
scanFailOn | String ! | "" | Fails if a vulnerability is found with a severity >= the given severity |
sign | Boolean ! | false | Sign the image with cosign |
cosignAnnotations | [String ! ] | [] | Extra key=value pairs to sign |
cosignKey | Secret | null | Private key to use for image signing |
cosignPassword | Secret | null | Password used to decrypt the Cosign Private key |
oidcProvider | String ! | "" | Specify the provider to get the OIDC token from |
force | Boolean | false | Force image publishing (invalidate cache) |
Example
dagger -m github.com/opopops/wolfi@c65ab999b4087d507052c855550b81ebd6cc90a5 call \
publish --image string --tag string1 --tag string2 --version string --scan boolean --scan-fail-on string --sign boolean --oidc-provider string
func (m *MyModule) Example(ctx context.Context, image string, tag []string, version string, scan bool, scanFailOn string, sign bool, oidcProvider string) string {
return dag.
Wolfi().
Publish(ctx, image, tag, version, scan, scanFailOn, sign, oidcProvider)
}
@function
async def example(image: str, tag: List[str], version: str, scan: bool, scan_fail_on: str, sign: bool, oidc_provider: str) -> str:
return await (
dag.wolfi()
.publish(image, tag, version, scan, scan_fail_on, sign, oidc_provider)
)
@func()
async example(image: string, tag: string[], version: string, scan: boolean, scanFailOn: string, sign: boolean, oidcProvider: string): Promise<string> {
return dag
.wolfi()
.publish(image, tag, version, scan, scanFailOn, sign, oidcProvider)
}
sbom() 🔗
Return the SBOM for the sepecified image config file
Return Type
File !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
image | String ! | - | Image name |
variant | String | "prod" | Image variant |
Example
dagger -m github.com/opopops/wolfi@c65ab999b4087d507052c855550b81ebd6cc90a5 call \
sbom --image string
func (m *MyModule) Example(image string) *dagger.File {
return dag.
Wolfi().
Sbom(image)
}
@function
def example(image: str) -> dagger.File:
return (
dag.wolfi()
.sbom(image)
)
@func()
example(image: string): File {
return dag
.wolfi()
.sbom(image)
}
scan() 🔗
Scan an image built from a YAML config file for vulnerabilities
Return Type
File !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
image | String ! | - | Image name |
variant | String | "prod" | Image variant |
failOn | String ! | "" | Fails if a vulnerability is found with a severity >= the given severity |
format | String ! | "table" | Output format |
Example
dagger -m github.com/opopops/wolfi@c65ab999b4087d507052c855550b81ebd6cc90a5 call \
scan --image string --fail-on string --format string
func (m *MyModule) Example(image string, failOn string, format string) *dagger.File {
return dag.
Wolfi().
Scan(image, failOn, format)
}
@function
def example(image: str, fail_on: str, format: str) -> dagger.File:
return (
dag.wolfi()
.scan(image, fail_on, format)
)
@func()
example(image: string, failOn: string, format: string): File {
return dag
.wolfi()
.scan(image, failOn, format)
}
scanImage() 🔗
Scan an image for vulnerabilities
Return Type
File !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
address | String ! | - | Address of the image to scan |
failOn | String ! | "" | Fails if a vulnerability is found with a severity >= the given severity |
format | String ! | "table" | Output format |
Example
dagger -m github.com/opopops/wolfi@c65ab999b4087d507052c855550b81ebd6cc90a5 call \
scan-image --address string --fail-on string --format string
func (m *MyModule) Example(address string, failOn string, format string) *dagger.File {
return dag.
Wolfi().
ScanImage(address, failOn, format)
}
@function
def example(address: str, fail_on: str, format: str) -> dagger.File:
return (
dag.wolfi()
.scan_image(address, fail_on, format)
)
@func()
example(address: string, failOn: string, format: string): File {
return dag
.wolfi()
.scanImage(address, failOn, format)
}
withDockerSocket() 🔗
Mounts a Docker Unix socket
Return Type
Wolfi !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
source | Socket ! | - | Identifier of the Docker socket to forward (e.g /var/run/docker.sock) |
Example
echo 'Custom types are not supported in shell examples'
func (m *MyModule) Example(source *dagger.Socket) *dagger.Wolfi {
return dag.
Wolfi().
WithDockerSocket(source)
}
@function
def example(source: dagger.Socket) -> dagger.Wolfi:
return (
dag.wolfi()
.with_docker_socket(source)
)
@func()
example(source: Socket): Wolfi {
return dag
.wolfi()
.withDockerSocket(source)
}
withEnvVariable() 🔗
Set a new environment variable
Return Type
Wolfi !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
name | String ! | - | Name of the environment variable |
value | String ! | - | Value of the environment variable |
expand | Boolean | false | Replace “${VAR}” or “$VAR” in the value according to the current environment variables defined in the container |
Example
dagger -m github.com/opopops/wolfi@c65ab999b4087d507052c855550b81ebd6cc90a5 call \
with-env-variable --name string --value string
func (m *MyModule) Example(name string, value string) *dagger.Wolfi {
return dag.
Wolfi().
WithEnvVariable(name, value)
}
@function
def example(name: str, value: str) -> dagger.Wolfi:
return (
dag.wolfi()
.with_env_variable(name, value)
)
@func()
example(name: string, value: string): Wolfi {
return dag
.wolfi()
.withEnvVariable(name, value)
}
withRegistryAuth() 🔗
Authenticate with registry
Return Type
Wolfi !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
username | String ! | - | Registry username |
secret | Secret ! | - | Registry password |
address | String ! | "ghcr.io" | Registry host |
Example
dagger -m github.com/opopops/wolfi@c65ab999b4087d507052c855550b81ebd6cc90a5 call \
with-registry-auth --username string --secret env:MYSECRET --address string
func (m *MyModule) Example(username string, secret *dagger.Secret, address string) *dagger.Wolfi {
return dag.
Wolfi().
WithRegistryAuth(username, secret, address)
}
@function
def example(username: str, secret: dagger.Secret, address: str) -> dagger.Wolfi:
return (
dag.wolfi()
.with_registry_auth(username, secret, address)
)
@func()
example(username: string, secret: Secret, address: string): Wolfi {
return dag
.wolfi()
.withRegistryAuth(username, secret, address)
}
withSecretVariable() 🔗
Set a new environment variable, using a secret value
Return Type
Wolfi !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
name | String ! | - | Name of the secret variable |
secret | Secret ! | - | Identifier of the secret value |
Example
dagger -m github.com/opopops/wolfi@c65ab999b4087d507052c855550b81ebd6cc90a5 call \
with-secret-variable --name string --secret env:MYSECRET
func (m *MyModule) Example(name string, secret *dagger.Secret) *dagger.Wolfi {
return dag.
Wolfi().
WithSecretVariable(name, secret)
}
@function
def example(name: str, secret: dagger.Secret) -> dagger.Wolfi:
return (
dag.wolfi()
.with_secret_variable(name, secret)
)
@func()
example(name: string, secret: Secret): Wolfi {
return dag
.wolfi()
.withSecretVariable(name, secret)
}