Dagger
Search

docker

Build, publish, scan and sign multi-platform Docker images.

Installation

dagger install github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805

Entrypoint

Return Type
Docker !
Arguments
NameTypeDefault ValueDescription
sourceDirectory -Working dir
imageString "cgr.dev/chainguard/wolfi-base:latest"wolfi-base image
versionString "latest"Docker CLI version
userString "nonroot"Image user
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
func (m *MyModule) Example() *dagger.Docker  {
	return dag.
			Docker()
}
@function
def example() -> dagger.Docker:
	return (
		dag.docker()
	)
@func()
example(): Docker {
	return dag
		.docker()
}

Types

Cli 🔗

Apko CLI

image() 🔗

Return Type
String !
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 docker \
 image
func (m *MyModule) Example(ctx context.Context) string  {
	return dag.
			Docker().
			Docker().
			Image(ctx)
}
@function
async def example() -> str:
	return await (
		dag.docker()
		.docker()
		.image()
	)
@func()
async example(): Promise<string> {
	return dag
		.docker()
		.docker()
		.image()
}

user() 🔗

Return Type
String !
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 docker \
 user
func (m *MyModule) Example(ctx context.Context) string  {
	return dag.
			Docker().
			Docker().
			User(ctx)
}
@function
async def example() -> str:
	return await (
		dag.docker()
		.docker()
		.user()
	)
@func()
async example(): Promise<string> {
	return dag
		.docker()
		.docker()
		.user()
}

version() 🔗

Return Type
String !
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 docker \
 version
func (m *MyModule) Example(ctx context.Context) string  {
	return dag.
			Docker().
			Docker().
			Version(ctx)
}
@function
async def example() -> str:
	return await (
		dag.docker()
		.docker()
		.version()
	)
@func()
async example(): Promise<string> {
	return dag
		.docker()
		.docker()
		.version()
}

container() 🔗

Returns the container

Return Type
Container !
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 docker \
 container
func (m *MyModule) Example() *dagger.Container  {
	return dag.
			Docker().
			Docker().
			Container()
}
@function
def example() -> dagger.Container:
	return (
		dag.docker()
		.docker()
		.container()
	)
@func()
example(): Container {
	return dag
		.docker()
		.docker()
		.container()
}

withEnvVariable() 🔗

Set a new environment variable in the Apko container

Return Type
Cli !
Arguments
NameTypeDefault ValueDescription
nameString !-Name of the environment variable
valueString !-Value of the environment variable
expandBoolean falseReplace “${VAR}” or “$VAR” in the value according to the current environment variables defined in the container
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 docker \
 with-env-variable --name string --value string
func (m *MyModule) Example(name string, value string) *dagger.DockerCli  {
	return dag.
			Docker().
			Docker().
			WithEnvVariable(name, value)
}
@function
def example(name: str, value: str) -> dagger.DockerCli:
	return (
		dag.docker()
		.docker()
		.with_env_variable(name, value)
	)
@func()
example(name: string, value: string): DockerCli {
	return dag
		.docker()
		.docker()
		.withEnvVariable(name, value)
}

withRegistryAuth() 🔗

Authenticates with registry

Return Type
Cli !
Arguments
NameTypeDefault ValueDescription
usernameString !-Registry username
secretSecret !-Registry password
addressString "docker.io"Registry host
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 docker \
 with-registry-auth --username string --secret env:MYSECRET
func (m *MyModule) Example(username string, secret *dagger.Secret) *dagger.DockerCli  {
	return dag.
			Docker().
			Docker().
			WithRegistryAuth(username, secret)
}
@function
def example(username: str, secret: dagger.Secret) -> dagger.DockerCli:
	return (
		dag.docker()
		.docker()
		.with_registry_auth(username, secret)
	)
@func()
example(username: string, secret: Secret): DockerCli {
	return dag
		.docker()
		.docker()
		.withRegistryAuth(username, secret)
}

withSecretVariable() 🔗

Set a new environment variable, using a secret value

Return Type
Cli !
Arguments
NameTypeDefault ValueDescription
nameString !-Name of the secret variable
secretSecret !-Identifier of the secret value
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 docker \
 with-secret-variable --name string --secret env:MYSECRET
func (m *MyModule) Example(name string, secret *dagger.Secret) *dagger.DockerCli  {
	return dag.
			Docker().
			Docker().
			WithSecretVariable(name, secret)
}
@function
def example(name: str, secret: dagger.Secret) -> dagger.DockerCli:
	return (
		dag.docker()
		.docker()
		.with_secret_variable(name, secret)
	)
@func()
example(name: string, secret: Secret): DockerCli {
	return dag
		.docker()
		.docker()
		.withSecretVariable(name, secret)
}

withUnixSocket() 🔗

Retrieves this Apko CLI plus a socket forwarded to the given Unix socket path

Return Type
Cli !
Arguments
NameTypeDefault ValueDescription
sourceSocket !-Identifier of the socket to forward
Example
echo 'Custom types are not supported in shell examples'
func (m *MyModule) Example(source *dagger.Socket) *dagger.DockerCli  {
	return dag.
			Docker().
			Docker().
			WithUnixSocket(source)
}
@function
def example(source: dagger.Socket) -> dagger.DockerCli:
	return (
		dag.docker()
		.docker()
		.with_unix_socket(source)
	)
@func()
example(source: Socket): DockerCli {
	return dag
		.docker()
		.docker()
		.withUnixSocket(source)
}

Sbom 🔗

SBOM files

directory() 🔗

Returns the SBOM directory

Return Type
Directory !
Example
Function DockerSbom.directory is not accessible from the docker module
Function DockerSbom.directory is not accessible from the docker module
Function DockerSbom.directory is not accessible from the docker module
Function DockerSbom.directory is not accessible from the docker module

file() 🔗

Returns the SBOM file for the specified platform (current platform if not specified)

Return Type
File !
Arguments
NameTypeDefault ValueDescription
platformScalar nullPlatform
Example
Function DockerSbom.file is not accessible from the docker module
Function DockerSbom.file is not accessible from the docker module
Function DockerSbom.file is not accessible from the docker module
Function DockerSbom.file is not accessible from the docker module

Image 🔗

Docker Image

address() 🔗

Return Type
String !
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 build \
 publish --tag string1 --tag string2 \
 address
func (m *MyModule) Example(ctx context.Context, tag []string) string  {
	return dag.
			Docker().
			Build().
			Publish(tag).
			Address(ctx)
}
@function
async def example(tag: List[str]) -> str:
	return await (
		dag.docker()
		.build()
		.publish(tag)
		.address()
	)
@func()
async example(tag: string[]): Promise<string> {
	return dag
		.docker()
		.build()
		.publish(tag)
		.address()
}

attest() 🔗

Attest image SBOMs with Cosign

Return Type
String !
Arguments
NameTypeDefault ValueDescription
privateKeySecret nullCosign private key
passwordSecret nullCosign password
identityTokenSecret nullCosign identity token
oidcProviderString ""Specify the provider to get the OIDC token from
oidcIssuerString ""OIDC provider to be used to issue ID toke
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 build \
 publish --tag string1 --tag string2 \
 attest
func (m *MyModule) Example(ctx context.Context, tag []string) string  {
	return dag.
			Docker().
			Build().
			Publish(tag).
			Attest(ctx)
}
@function
async def example(tag: List[str]) -> str:
	return await (
		dag.docker()
		.build()
		.publish(tag)
		.attest()
	)
@func()
async example(tag: string[]): Promise<string> {
	return dag
		.docker()
		.build()
		.publish(tag)
		.attest()
}

container() 🔗

Returns the container for the specified platform (current platform if not specified)

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
platformScalar nullPlatform
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 build \
 publish --tag string1 --tag string2 \
 container
func (m *MyModule) Example(tag []string) *dagger.Container  {
	return dag.
			Docker().
			Build().
			Publish(tag).
			Container()
}
@function
def example(tag: List[str]) -> dagger.Container:
	return (
		dag.docker()
		.build()
		.publish(tag)
		.container()
	)
@func()
example(tag: string[]): Container {
	return dag
		.docker()
		.build()
		.publish(tag)
		.container()
}

copy() 🔗

Copy image to another registry

Return Type
String !
Arguments
NameTypeDefault ValueDescription
targetString !-Target
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 build \
 publish --tag string1 --tag string2 \
 copy --target string
func (m *MyModule) Example(ctx context.Context, tag []string, target string) string  {
	return dag.
			Docker().
			Build().
			Publish(tag).
			Copy(ctx, target)
}
@function
async def example(tag: List[str], target: str) -> str:
	return await (
		dag.docker()
		.build()
		.publish(tag)
		.copy(target)
	)
@func()
async example(tag: string[], target: string): Promise<string> {
	return dag
		.docker()
		.build()
		.publish(tag)
		.copy(target)
}

digest() 🔗

Retrieves the image digest

Return Type
String !
Arguments
NameTypeDefault ValueDescription
platformScalar nullPlatform
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 build \
 publish --tag string1 --tag string2 \
 digest
func (m *MyModule) Example(ctx context.Context, tag []string) string  {
	return dag.
			Docker().
			Build().
			Publish(tag).
			Digest(ctx)
}
@function
async def example(tag: List[str]) -> str:
	return await (
		dag.docker()
		.build()
		.publish(tag)
		.digest()
	)
@func()
async example(tag: string[]): Promise<string> {
	return dag
		.docker()
		.build()
		.publish(tag)
		.digest()
}

platforms() 🔗

Retrieves image platforms

Return Type
[Scalar ! ] !
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 build \
 publish --tag string1 --tag string2 \
 platforms
func (m *MyModule) Example(tag []string) []  {
	return dag.
			Docker().
			Build().
			Publish(tag).
			Platforms()
}
@function
def example(tag: List[str]) -> List[]:
	return (
		dag.docker()
		.build()
		.publish(tag)
		.platforms()
	)
@func()
example(tag: string[]): [] {
	return dag
		.docker()
		.build()
		.publish(tag)
		.platforms()
}

ref() 🔗

Retrieves the fully qualified image ref

Return Type
String !
Arguments
NameTypeDefault ValueDescription
platformScalar nullPlatform
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 build \
 publish --tag string1 --tag string2 \
 ref
func (m *MyModule) Example(ctx context.Context, tag []string) string  {
	return dag.
			Docker().
			Build().
			Publish(tag).
			Ref(ctx)
}
@function
async def example(tag: List[str]) -> str:
	return await (
		dag.docker()
		.build()
		.publish(tag)
		.ref()
	)
@func()
async example(tag: string[]): Promise<string> {
	return dag
		.docker()
		.build()
		.publish(tag)
		.ref()
}

registry() 🔗

Retrieves the registry host from image address

Return Type
String !
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 build \
 publish --tag string1 --tag string2 \
 registry
func (m *MyModule) Example(ctx context.Context, tag []string) string  {
	return dag.
			Docker().
			Build().
			Publish(tag).
			Registry(ctx)
}
@function
async def example(tag: List[str]) -> str:
	return await (
		dag.docker()
		.build()
		.publish(tag)
		.registry()
	)
@func()
async example(tag: string[]): Promise<string> {
	return dag
		.docker()
		.build()
		.publish(tag)
		.registry()
}

sbom() 🔗

Returns the SBOM directory

Return Type
Directory !
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 build \
 publish --tag string1 --tag string2 \
 sbom
func (m *MyModule) Example(tag []string) *dagger.Directory  {
	return dag.
			Docker().
			Build().
			Publish(tag).
			Sbom()
}
@function
def example(tag: List[str]) -> dagger.Directory:
	return (
		dag.docker()
		.build()
		.publish(tag)
		.sbom()
	)
@func()
example(tag: string[]): Directory {
	return dag
		.docker()
		.build()
		.publish(tag)
		.sbom()
}

sbomFile() 🔗

Return the SBOM for the specified platform (index if not specified)

Return Type
File !
Arguments
NameTypeDefault ValueDescription
platformScalar nullPlatform
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 build \
 publish --tag string1 --tag string2 \
 sbom-file
func (m *MyModule) Example(tag []string) *dagger.File  {
	return dag.
			Docker().
			Build().
			Publish(tag).
			SbomFile()
}
@function
def example(tag: List[str]) -> dagger.File:
	return (
		dag.docker()
		.build()
		.publish(tag)
		.sbom_file()
	)
@func()
example(tag: string[]): File {
	return dag
		.docker()
		.build()
		.publish(tag)
		.sbomFile()
}

scan() 🔗

Scan image using Grype

Return Type
File !
Arguments
NameTypeDefault ValueDescription
severityCutoffString nullNo description provided
failBoolean !trueSet to false to avoid failing based on severity-cutoff
outputFormatString "table"Report output formatter
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 build \
 publish --tag string1 --tag string2 \
 scan --fail boolean
func (m *MyModule) Example(tag []string, fail bool) *dagger.File  {
	return dag.
			Docker().
			Build().
			Publish(tag).
			Scan(fail)
}
@function
def example(tag: List[str], fail: bool) -> dagger.File:
	return (
		dag.docker()
		.build()
		.publish(tag)
		.scan(fail)
	)
@func()
example(tag: string[], fail: boolean): File {
	return dag
		.docker()
		.build()
		.publish(tag)
		.scan(fail)
}

sign() 🔗

Sign image with Cosign

Return Type
String !
Arguments
NameTypeDefault ValueDescription
privateKeySecret nullNo description provided
passwordSecret nullNo description provided
oidcProviderString nullNo description provided
oidcIssuerString nullNo description provided
recursiveBoolean trueNo description provided
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 build \
 publish --tag string1 --tag string2 \
 sign
func (m *MyModule) Example(ctx context.Context, tag []string) string  {
	return dag.
			Docker().
			Build().
			Publish(tag).
			Sign(ctx)
}
@function
async def example(tag: List[str]) -> str:
	return await (
		dag.docker()
		.build()
		.publish(tag)
		.sign()
	)
@func()
async example(tag: string[]): Promise<string> {
	return dag
		.docker()
		.build()
		.publish(tag)
		.sign()
}

tag() 🔗

Tag image

Return Type
String !
Arguments
NameTypeDefault ValueDescription
tagString !-Tag
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 build \
 publish --tag string1 --tag string2 \
 tag --tag string
func (m *MyModule) Example(ctx context.Context, tag []string, tag1 string) string  {
	return dag.
			Docker().
			Build().
			Publish(tag).
			Tag(ctx, tag1)
}
@function
async def example(tag: List[str], tag1: str) -> str:
	return await (
		dag.docker()
		.build()
		.publish(tag)
		.tag(tag1)
	)
@func()
async example(tag: string[], tag1: string): Promise<string> {
	return dag
		.docker()
		.build()
		.publish(tag)
		.tag(tag1)
}

tarball() 🔗

Returns the container tarball for the specified platform

Return Type
File !
Arguments
NameTypeDefault ValueDescription
platformScalar nullPlatform
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 build \
 publish --tag string1 --tag string2 \
 tarball
func (m *MyModule) Example(tag []string) *dagger.File  {
	return dag.
			Docker().
			Build().
			Publish(tag).
			Tarball()
}
@function
def example(tag: List[str]) -> dagger.File:
	return (
		dag.docker()
		.build()
		.publish(tag)
		.tarball()
	)
@func()
example(tag: string[]): File {
	return dag
		.docker()
		.build()
		.publish(tag)
		.tarball()
}

withAttest() 🔗

Attest image SBOMs with Cosign (for chaining)

Return Type
Image !
Arguments
NameTypeDefault ValueDescription
privateKeySecret nullCosign private key
passwordSecret nullCosign password
identityTokenSecret nullCosign identity token
oidcProviderString ""Specify the provider to get the OIDC token from
oidcIssuerString ""OIDC provider to be used to issue ID toke
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 build \
 publish --tag string1 --tag string2 \
 with-attest
func (m *MyModule) Example(tag []string) *dagger.DockerImage  {
	return dag.
			Docker().
			Build().
			Publish(tag).
			WithAttest()
}
@function
def example(tag: List[str]) -> dagger.DockerImage:
	return (
		dag.docker()
		.build()
		.publish(tag)
		.with_attest()
	)
@func()
example(tag: string[]): DockerImage {
	return dag
		.docker()
		.build()
		.publish(tag)
		.withAttest()
}

withCopy() 🔗

Copy image to another registry (for chaining)

Return Type
Image !
Arguments
NameTypeDefault ValueDescription
targetString !-Target
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 build \
 publish --tag string1 --tag string2 \
 with-copy --target string
func (m *MyModule) Example(tag []string, target string) *dagger.DockerImage  {
	return dag.
			Docker().
			Build().
			Publish(tag).
			WithCopy(target)
}
@function
def example(tag: List[str], target: str) -> dagger.DockerImage:
	return (
		dag.docker()
		.build()
		.publish(tag)
		.with_copy(target)
	)
@func()
example(tag: string[], target: string): DockerImage {
	return dag
		.docker()
		.build()
		.publish(tag)
		.withCopy(target)
}

withRegistryAuth() 🔗

Authenticate with registry

Return Type
Image !
Arguments
NameTypeDefault ValueDescription
usernameString !-Registry username
secretSecret !-Registry password
addressString "docker.io"Registry host
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 build \
 publish --tag string1 --tag string2 \
 with-registry-auth --username string --secret env:MYSECRET
func (m *MyModule) Example(tag []string, username string, secret *dagger.Secret) *dagger.DockerImage  {
	return dag.
			Docker().
			Build().
			Publish(tag).
			WithRegistryAuth(username, secret)
}
@function
def example(tag: List[str], username: str, secret: dagger.Secret) -> dagger.DockerImage:
	return (
		dag.docker()
		.build()
		.publish(tag)
		.with_registry_auth(username, secret)
	)
@func()
example(tag: string[], username: string, secret: Secret): DockerImage {
	return dag
		.docker()
		.build()
		.publish(tag)
		.withRegistryAuth(username, secret)
}

withScan() 🔗

Scan image using Grype (for chaining)

Return Type
Image !
Arguments
NameTypeDefault ValueDescription
severityCutoffString nullNo description provided
failBoolean trueSet to false to avoid failing based on severity-cutoff
outputFormatString "table"Report output formatter
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 build \
 publish --tag string1 --tag string2 \
 with-scan
func (m *MyModule) Example(tag []string) *dagger.DockerImage  {
	return dag.
			Docker().
			Build().
			Publish(tag).
			WithScan()
}
@function
def example(tag: List[str]) -> dagger.DockerImage:
	return (
		dag.docker()
		.build()
		.publish(tag)
		.with_scan()
	)
@func()
example(tag: string[]): DockerImage {
	return dag
		.docker()
		.build()
		.publish(tag)
		.withScan()
}

withSign() 🔗

Sign image with Cosign (for chaining)

Return Type
Image !
Arguments
NameTypeDefault ValueDescription
privateKeySecret nullNo description provided
passwordSecret nullNo description provided
oidcProviderString nullNo description provided
oidcIssuerString nullNo description provided
recursiveBoolean trueNo description provided
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 build \
 publish --tag string1 --tag string2 \
 with-sign
func (m *MyModule) Example(tag []string) *dagger.DockerImage  {
	return dag.
			Docker().
			Build().
			Publish(tag).
			WithSign()
}
@function
def example(tag: List[str]) -> dagger.DockerImage:
	return (
		dag.docker()
		.build()
		.publish(tag)
		.with_sign()
	)
@func()
example(tag: string[]): DockerImage {
	return dag
		.docker()
		.build()
		.publish(tag)
		.withSign()
}

withTag() 🔗

Tag image (for chaining)

Return Type
Image !
Arguments
NameTypeDefault ValueDescription
tagString !-Tag
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 build \
 publish --tag string1 --tag string2 \
 with-tag --tag string
func (m *MyModule) Example(tag []string, tag1 string) *dagger.DockerImage  {
	return dag.
			Docker().
			Build().
			Publish(tag).
			WithTag(tag1)
}
@function
def example(tag: List[str], tag1: str) -> dagger.DockerImage:
	return (
		dag.docker()
		.build()
		.publish(tag)
		.with_tag(tag1)
	)
@func()
example(tag: string[], tag1: string): DockerImage {
	return dag
		.docker()
		.build()
		.publish(tag)
		.withTag(tag1)
}

Build 🔗

Docker Build

asDirectory() 🔗

Returns the build as directory including tarball and sbom dir

Return Type
Directory !
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 build \
 as-directory
func (m *MyModule) Example() *dagger.Directory  {
	return dag.
			Docker().
			Build().
			AsDirectory()
}
@function
def example() -> dagger.Directory:
	return (
		dag.docker()
		.build()
		.as_directory()
	)
@func()
example(): Directory {
	return dag
		.docker()
		.build()
		.asDirectory()
}

asTarball() 🔗

Returns the build as tarball

Return Type
File !
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 build \
 as-tarball
func (m *MyModule) Example() *dagger.File  {
	return dag.
			Docker().
			Build().
			AsTarball()
}
@function
def example() -> dagger.File:
	return (
		dag.docker()
		.build()
		.as_tarball()
	)
@func()
example(): File {
	return dag
		.docker()
		.build()
		.asTarball()
}

container() 🔗

Returns the container for the specified platform (current platform if not specified)

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
platformScalar nullPlatform
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 build \
 container
func (m *MyModule) Example() *dagger.Container  {
	return dag.
			Docker().
			Build().
			Container()
}
@function
def example() -> dagger.Container:
	return (
		dag.docker()
		.build()
		.container()
	)
@func()
example(): Container {
	return dag
		.docker()
		.build()
		.container()
}

platforms() 🔗

Retrieves build platforms

Return Type
[Scalar ! ] !
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 build \
 platforms
func (m *MyModule) Example() []  {
	return dag.
			Docker().
			Build().
			Platforms()
}
@function
def example() -> List[]:
	return (
		dag.docker()
		.build()
		.platforms()
	)
@func()
example(): [] {
	return dag
		.docker()
		.build()
		.platforms()
}

publish() 🔗

Publish image

Return Type
Image !
Arguments
NameTypeDefault ValueDescription
tag[String ! ] !-Image tags
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 build \
 publish --tag string1 --tag string2
func (m *MyModule) Example(tag []string) *dagger.DockerImage  {
	return dag.
			Docker().
			Build().
			Publish(tag)
}
@function
def example(tag: List[str]) -> dagger.DockerImage:
	return (
		dag.docker()
		.build()
		.publish(tag)
	)
@func()
example(tag: string[]): DockerImage {
	return dag
		.docker()
		.build()
		.publish(tag)
}

sbom() 🔗

Returns the SBOM directory

Return Type
Directory !
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 build \
 sbom
func (m *MyModule) Example() *dagger.Directory  {
	return dag.
			Docker().
			Build().
			Sbom()
}
@function
def example() -> dagger.Directory:
	return (
		dag.docker()
		.build()
		.sbom()
	)
@func()
example(): Directory {
	return dag
		.docker()
		.build()
		.sbom()
}

sbomFile() 🔗

Returns the SBOM for the specified platform (index if not specified)

Return Type
File !
Arguments
NameTypeDefault ValueDescription
platformScalar nullPlatform
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 build \
 sbom-file
func (m *MyModule) Example() *dagger.File  {
	return dag.
			Docker().
			Build().
			SbomFile()
}
@function
def example() -> dagger.File:
	return (
		dag.docker()
		.build()
		.sbom_file()
	)
@func()
example(): File {
	return dag
		.docker()
		.build()
		.sbomFile()
}

scan() 🔗

Scan build result using Grype

Return Type
File !
Arguments
NameTypeDefault ValueDescription
severityCutoffString nullNo description provided
failBoolean trueSet to false to avoid failing based on severity-cutoff
outputFormatString "table"Report output formatter
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 build \
 scan
func (m *MyModule) Example() *dagger.File  {
	return dag.
			Docker().
			Build().
			Scan()
}
@function
def example() -> dagger.File:
	return (
		dag.docker()
		.build()
		.scan()
	)
@func()
example(): File {
	return dag
		.docker()
		.build()
		.scan()
}

tarball() 🔗

Returns the container tarball for the specified platform

Return Type
File !
Arguments
NameTypeDefault ValueDescription
platformScalar nullPlatform
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 build \
 tarball
func (m *MyModule) Example() *dagger.File  {
	return dag.
			Docker().
			Build().
			Tarball()
}
@function
def example() -> dagger.File:
	return (
		dag.docker()
		.build()
		.tarball()
	)
@func()
example(): File {
	return dag
		.docker()
		.build()
		.tarball()
}

withRegistryAuth() 🔗

Authenticate with registry

Return Type
Build !
Arguments
NameTypeDefault ValueDescription
usernameString !-Registry username
secretSecret !-Registry password
addressString !"docker.io"Registry host
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 build \
 with-registry-auth --username string --secret env:MYSECRET --address string
func (m *MyModule) Example(username string, secret *dagger.Secret, address string) *dagger.DockerBuild  {
	return dag.
			Docker().
			Build().
			WithRegistryAuth(username, secret, address)
}
@function
def example(username: str, secret: dagger.Secret, address: str) -> dagger.DockerBuild:
	return (
		dag.docker()
		.build()
		.with_registry_auth(username, secret, address)
	)
@func()
example(username: string, secret: Secret, address: string): DockerBuild {
	return dag
		.docker()
		.build()
		.withRegistryAuth(username, secret, address)
}

withScan() 🔗

Scan build result using Grype (for chaining)

Return Type
Build !
Arguments
NameTypeDefault ValueDescription
severityCutoffString nullNo description provided
failBoolean trueSet to false to avoid failing based on severity-cutoff
outputFormatString "table"Report output formatter
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 build \
 with-scan
func (m *MyModule) Example() *dagger.DockerBuild  {
	return dag.
			Docker().
			Build().
			WithScan()
}
@function
def example() -> dagger.DockerBuild:
	return (
		dag.docker()
		.build()
		.with_scan()
	)
@func()
example(): DockerBuild {
	return dag
		.docker()
		.build()
		.withScan()
}

Docker 🔗

Docker

build() 🔗

Build multi-arch OCI image

Return Type
Build !
Arguments
NameTypeDefault ValueDescription
dockerfileString "Dockerfile"Location of the Dockerfile
targetString ""Set the target build stage to build
buildArg[String ! ] []Build args to pass to the build in the format of name=value
secret[Secret ! ] []Secrets to pass to the build
platform[Scalar ! ] []Set target platform for build
sbomBoolean truegenerate SBOM
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 build
func (m *MyModule) Example() *dagger.DockerBuild  {
	return dag.
			Docker().
			Build()
}
@function
def example() -> dagger.DockerBuild:
	return (
		dag.docker()
		.build()
	)
@func()
example(): DockerBuild {
	return dag
		.docker()
		.build()
}

container() 🔗

Returns the docker container

Return Type
Container !
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 container
func (m *MyModule) Example() *dagger.Container  {
	return dag.
			Docker().
			Container()
}
@function
def example() -> dagger.Container:
	return (
		dag.docker()
		.container()
	)
@func()
example(): Container {
	return dag
		.docker()
		.container()
}

docker() 🔗

Returns the Apko CLI

Return Type
Cli !
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 docker
func (m *MyModule) Example() *dagger.DockerCli  {
	return dag.
			Docker().
			Docker()
}
@function
def example() -> dagger.DockerCli:
	return (
		dag.docker()
		.docker()
	)
@func()
example(): DockerCli {
	return dag
		.docker()
		.docker()
}

withEnvVariable() 🔗

Set a new environment variable in the Apko container

Return Type
Docker !
Arguments
NameTypeDefault ValueDescription
nameString !-Name of the environment variable
valueString !-Value of the environment variable
expandBoolean falseReplace “${VAR}” or “$VAR” in the value according to the current environment variables defined in the container
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 with-env-variable --name string --value string
func (m *MyModule) Example(name string, value string) *dagger.Docker  {
	return dag.
			Docker().
			WithEnvVariable(name, value)
}
@function
def example(name: str, value: str) -> dagger.Docker:
	return (
		dag.docker()
		.with_env_variable(name, value)
	)
@func()
example(name: string, value: string): Docker {
	return dag
		.docker()
		.withEnvVariable(name, value)
}

withRegistryAuth() 🔗

Authenticate with registry

Return Type
Docker !
Arguments
NameTypeDefault ValueDescription
usernameString !-Registry username
secretSecret !-Registry password
addressString "docker.io"Registry host
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 with-registry-auth --username string --secret env:MYSECRET
func (m *MyModule) Example(username string, secret *dagger.Secret) *dagger.Docker  {
	return dag.
			Docker().
			WithRegistryAuth(username, secret)
}
@function
def example(username: str, secret: dagger.Secret) -> dagger.Docker:
	return (
		dag.docker()
		.with_registry_auth(username, secret)
	)
@func()
example(username: string, secret: Secret): Docker {
	return dag
		.docker()
		.withRegistryAuth(username, secret)
}

withSecretVariable() 🔗

Set a new environment variable, using a secret value

Return Type
Docker !
Arguments
NameTypeDefault ValueDescription
nameString !-Name of the secret variable
secretSecret !-Identifier of the secret value
Example
dagger -m github.com/opopops/daggerverse/docker@b352411e8b8d0b5e2705e1f5e3db386fc35b5805 call \
 with-secret-variable --name string --secret env:MYSECRET
func (m *MyModule) Example(name string, secret *dagger.Secret) *dagger.Docker  {
	return dag.
			Docker().
			WithSecretVariable(name, secret)
}
@function
def example(name: str, secret: dagger.Secret) -> dagger.Docker:
	return (
		dag.docker()
		.with_secret_variable(name, secret)
	)
@func()
example(name: string, secret: Secret): Docker {
	return dag
		.docker()
		.withSecretVariable(name, secret)
}

withUnixSocket() 🔗

Retrieves the Apko container plus a socket forwarded to the given Unix socket path

Return Type
Docker !
Arguments
NameTypeDefault ValueDescription
sourceSocket !-Identifier of the socket to forward
Example
echo 'Custom types are not supported in shell examples'
func (m *MyModule) Example(source *dagger.Socket) *dagger.Docker  {
	return dag.
			Docker().
			WithUnixSocket(source)
}
@function
def example(source: dagger.Socket) -> dagger.Docker:
	return (
		dag.docker()
		.with_unix_socket(source)
	)
@func()
example(source: Socket): Docker {
	return dag
		.docker()
		.withUnixSocket(source)
}