Dagger
Search

docker

Dagger-native Docker and OCI image helpers.

Installation

dagger install github.com/riftonix/daggerverse/modules/docker@8e5d9658ac5314d28f7f9a7bfbaa2deca5796f3e

Entrypoint

Return Type
RegistryAuth !
Arguments
NameTypeDefault ValueDescription
addressString !-No description provided
usernameString !-No description provided
passwordSecret !-No description provided
Example
Function RegistryAuth.Constructor is not accessible from the docker module
Function RegistryAuth.Constructor is not accessible from the docker module
Function RegistryAuth.Constructor is not accessible from the docker module
Function RegistryAuth.Constructor is not accessible from the docker module

Entrypoint

Return Type
Build !
Arguments
NameTypeDefault ValueDescription
containerContainer !-No description provided
contextPathString !-No description provided
dockerfilePathString !-No description provided
targetString -No description provided
buildArgs[String ! ] !-No description provided
platforms[Scalar ! ] !-No description provided
platformVariants[Container ! ] !-No description provided
registryAuths[RegistryAuth ! ] nullNo description provided
publishDryRunBoolean !falseNo description provided
Example
Function Build.Constructor is not accessible from the docker module
Function Build.Constructor is not accessible from the docker module
Function Build.Constructor is not accessible from the docker module
Function Build.Constructor is not accessible from the docker module

Entrypoint

Return Type
Image !
Arguments
NameTypeDefault ValueDescription
imageRefString !-No description provided
imageRefs[String ! ] nullNo description provided
Example
Function Image.Constructor is not accessible from the docker module
Function Image.Constructor is not accessible from the docker module
Function Image.Constructor is not accessible from the docker module
Function Image.Constructor is not accessible from the docker module

Entrypoint

Return Type
Docker !
Arguments
NameTypeDefault ValueDescription
registryAuths[RegistryAuth ! ] nullNo description provided
Example
dagger -m github.com/riftonix/daggerverse/modules/docker@8e5d9658ac5314d28f7f9a7bfbaa2deca5796f3e 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

RegistryAuth 🔗

Registry authentication configuration.

address() 🔗

Return the registry address.

Return Type
String !
Example
Function DockerRegistryAuth.address is not accessible from the docker module
Function DockerRegistryAuth.address is not accessible from the docker module
Function DockerRegistryAuth.address is not accessible from the docker module
Function DockerRegistryAuth.address is not accessible from the docker module

username() 🔗

Return the registry username.

Return Type
String !
Example
Function DockerRegistryAuth.username is not accessible from the docker module
Function DockerRegistryAuth.username is not accessible from the docker module
Function DockerRegistryAuth.username is not accessible from the docker module
Function DockerRegistryAuth.username is not accessible from the docker module

Build 🔗

Container image build result.

container() 🔗

Return the built container.

Return Type
Container !
Example
dagger -m github.com/riftonix/daggerverse/modules/docker@8e5d9658ac5314d28f7f9a7bfbaa2deca5796f3e call \
 build --context-path string --dockerfile-path string \
 container
func (m *MyModule) Example(contextPath string, dockerfilePath string) *dagger.Container  {
	return dag.
			Docker().
			Build(contextPath, dockerfilePath).
			Container()
}
@function
def example(context_path: str, dockerfile_path: str) -> dagger.Container:
	return (
		dag.docker()
		.build(context_path, dockerfile_path)
		.container()
	)
@func()
example(contextPath: string, dockerfilePath: string): Container {
	return dag
		.docker()
		.build(contextPath, dockerfilePath)
		.container()
}

contextPath() 🔗

Return the build context path.

Return Type
String !
Example
dagger -m github.com/riftonix/daggerverse/modules/docker@8e5d9658ac5314d28f7f9a7bfbaa2deca5796f3e call \
 build --context-path string --dockerfile-path string \
 context-path
func (m *MyModule) Example(ctx context.Context, contextPath string, dockerfilePath string) string  {
	return dag.
			Docker().
			Build(contextPath, dockerfilePath).
			ContextPath(ctx)
}
@function
async def example(context_path: str, dockerfile_path: str) -> str:
	return await (
		dag.docker()
		.build(context_path, dockerfile_path)
		.context_path()
	)
@func()
async example(contextPath: string, dockerfilePath: string): Promise<string> {
	return dag
		.docker()
		.build(contextPath, dockerfilePath)
		.contextPath()
}

dockerfilePath() 🔗

Return the Dockerfile path.

Return Type
String !
Example
dagger -m github.com/riftonix/daggerverse/modules/docker@8e5d9658ac5314d28f7f9a7bfbaa2deca5796f3e call \
 build --context-path string --dockerfile-path string \
 dockerfile-path
func (m *MyModule) Example(ctx context.Context, contextPath string, dockerfilePath string) string  {
	return dag.
			Docker().
			Build(contextPath, dockerfilePath).
			DockerfilePath(ctx)
}
@function
async def example(context_path: str, dockerfile_path: str) -> str:
	return await (
		dag.docker()
		.build(context_path, dockerfile_path)
		.dockerfile_path()
	)
@func()
async example(contextPath: string, dockerfilePath: string): Promise<string> {
	return dag
		.docker()
		.build(contextPath, dockerfilePath)
		.dockerfilePath()
}

target() 🔗

Return the build target, if configured.

Return Type
String !
Example
dagger -m github.com/riftonix/daggerverse/modules/docker@8e5d9658ac5314d28f7f9a7bfbaa2deca5796f3e call \
 build --context-path string --dockerfile-path string \
 target
func (m *MyModule) Example(ctx context.Context, contextPath string, dockerfilePath string) string  {
	return dag.
			Docker().
			Build(contextPath, dockerfilePath).
			Target(ctx)
}
@function
async def example(context_path: str, dockerfile_path: str) -> str:
	return await (
		dag.docker()
		.build(context_path, dockerfile_path)
		.target()
	)
@func()
async example(contextPath: string, dockerfilePath: string): Promise<string> {
	return dag
		.docker()
		.build(contextPath, dockerfilePath)
		.target()
}

buildArgs() 🔗

Return configured build arguments.

Return Type
[String ! ] !
Example
dagger -m github.com/riftonix/daggerverse/modules/docker@8e5d9658ac5314d28f7f9a7bfbaa2deca5796f3e call \
 build --context-path string --dockerfile-path string \
 build-args
func (m *MyModule) Example(ctx context.Context, contextPath string, dockerfilePath string) []string  {
	return dag.
			Docker().
			Build(contextPath, dockerfilePath).
			BuildArgs(ctx)
}
@function
async def example(context_path: str, dockerfile_path: str) -> List[str]:
	return await (
		dag.docker()
		.build(context_path, dockerfile_path)
		.build_args()
	)
@func()
async example(contextPath: string, dockerfilePath: string): Promise<string[]> {
	return dag
		.docker()
		.build(contextPath, dockerfilePath)
		.buildArgs()
}

platforms() 🔗

Return configured target platforms.

Return Type
[Scalar ! ] !
Example
dagger -m github.com/riftonix/daggerverse/modules/docker@8e5d9658ac5314d28f7f9a7bfbaa2deca5796f3e call \
 build --context-path string --dockerfile-path string \
 platforms
func (m *MyModule) Example(contextPath string, dockerfilePath string) []  {
	return dag.
			Docker().
			Build(contextPath, dockerfilePath).
			Platforms()
}
@function
def example(context_path: str, dockerfile_path: str) -> List[]:
	return (
		dag.docker()
		.build(context_path, dockerfile_path)
		.platforms()
	)
@func()
example(contextPath: string, dockerfilePath: string): [] {
	return dag
		.docker()
		.build(contextPath, dockerfilePath)
		.platforms()
}

platformVariants() 🔗

Return platform-specific container variants.

Return Type
[Container ! ] !
Example
dagger -m github.com/riftonix/daggerverse/modules/docker@8e5d9658ac5314d28f7f9a7bfbaa2deca5796f3e call \
 build --context-path string --dockerfile-path string \
 platform-variants
func (m *MyModule) Example(contextPath string, dockerfilePath string) []*dagger.Container  {
	return dag.
			Docker().
			Build(contextPath, dockerfilePath).
			PlatformVariants()
}
@function
def example(context_path: str, dockerfile_path: str) -> List[dagger.Container]:
	return (
		dag.docker()
		.build(context_path, dockerfile_path)
		.platform_variants()
	)
@func()
example(contextPath: string, dockerfilePath: string): Container[] {
	return dag
		.docker()
		.build(contextPath, dockerfilePath)
		.platformVariants()
}

withSmokeCheck() 🔗

Run a smoke command in the built container.

Return Type
Build !
Arguments
NameTypeDefault ValueDescription
command[String ! ] !-Command to run in the built container
Example
dagger -m github.com/riftonix/daggerverse/modules/docker@8e5d9658ac5314d28f7f9a7bfbaa2deca5796f3e call \
 build --context-path string --dockerfile-path string \
 with-smoke-check --command string1 --command string2
func (m *MyModule) Example(contextPath string, dockerfilePath string, command []string) *dagger.DockerBuild  {
	return dag.
			Docker().
			Build(contextPath, dockerfilePath).
			WithSmokeCheck(command)
}
@function
def example(context_path: str, dockerfile_path: str, command: List[str]) -> dagger.DockerBuild:
	return (
		dag.docker()
		.build(context_path, dockerfile_path)
		.with_smoke_check(command)
	)
@func()
example(contextPath: string, dockerfilePath: string, command: string[]): DockerBuild {
	return dag
		.docker()
		.build(contextPath, dockerfilePath)
		.withSmokeCheck(command)
}

withPublishDryRun() 🔗

Return a build that validates publish inputs without pushing.

Return Type
Build !
Example
dagger -m github.com/riftonix/daggerverse/modules/docker@8e5d9658ac5314d28f7f9a7bfbaa2deca5796f3e call \
 build --context-path string --dockerfile-path string \
 with-publish-dry-run
func (m *MyModule) Example(contextPath string, dockerfilePath string) *dagger.DockerBuild  {
	return dag.
			Docker().
			Build(contextPath, dockerfilePath).
			WithPublishDryRun()
}
@function
def example(context_path: str, dockerfile_path: str) -> dagger.DockerBuild:
	return (
		dag.docker()
		.build(context_path, dockerfile_path)
		.with_publish_dry_run()
	)
@func()
example(contextPath: string, dockerfilePath: string): DockerBuild {
	return dag
		.docker()
		.build(contextPath, dockerfilePath)
		.withPublishDryRun()
}

publish() 🔗

Publish the built image to one or more OCI image references.

Return Type
Image !
Arguments
NameTypeDefault ValueDescription
imageRefs[String ! ] !-OCI image references to publish
Example
dagger -m github.com/riftonix/daggerverse/modules/docker@8e5d9658ac5314d28f7f9a7bfbaa2deca5796f3e call \
 build --context-path string --dockerfile-path string \
 publish --image-refs string1 --image-refs string2
func (m *MyModule) Example(contextPath string, dockerfilePath string, imageRefs []string) *dagger.DockerImage  {
	return dag.
			Docker().
			Build(contextPath, dockerfilePath).
			Publish(imageRefs)
}
@function
def example(context_path: str, dockerfile_path: str, image_refs: List[str]) -> dagger.DockerImage:
	return (
		dag.docker()
		.build(context_path, dockerfile_path)
		.publish(image_refs)
	)
@func()
example(contextPath: string, dockerfilePath: string, imageRefs: string[]): DockerImage {
	return dag
		.docker()
		.build(contextPath, dockerfilePath)
		.publish(imageRefs)
}

Image 🔗

Published image result.

imageRef() 🔗

Return the published image reference.

Return Type
String !
Example
dagger -m github.com/riftonix/daggerverse/modules/docker@8e5d9658ac5314d28f7f9a7bfbaa2deca5796f3e call \
 image --image-ref string \
 image-ref
func (m *MyModule) Example(ctx context.Context, imageRef string) string  {
	return dag.
			Docker().
			Image(imageRef).
			ImageRef(ctx)
}
@function
async def example(image_ref: str) -> str:
	return await (
		dag.docker()
		.image(image_ref)
		.image_ref()
	)
@func()
async example(imageRef: string): Promise<string> {
	return dag
		.docker()
		.image(imageRef)
		.imageRef()
}

imageRefs() 🔗

Return all published image references.

Return Type
[String ! ] !
Example
dagger -m github.com/riftonix/daggerverse/modules/docker@8e5d9658ac5314d28f7f9a7bfbaa2deca5796f3e call \
 image --image-ref string \
 image-refs
func (m *MyModule) Example(ctx context.Context, imageRef string) []string  {
	return dag.
			Docker().
			Image(imageRef).
			ImageRefs(ctx)
}
@function
async def example(image_ref: str) -> List[str]:
	return await (
		dag.docker()
		.image(image_ref)
		.image_refs()
	)
@func()
async example(imageRef: string): Promise<string[]> {
	return dag
		.docker()
		.image(imageRef)
		.imageRefs()
}

Docker 🔗

Docker module entrypoint.

module() 🔗

Return the module name.

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

registryAuthAddresses() 🔗

Return configured registry auth addresses.

Return Type
[String ! ] !
Example
dagger -m github.com/riftonix/daggerverse/modules/docker@8e5d9658ac5314d28f7f9a7bfbaa2deca5796f3e call \
 registry-auth-addresses
func (m *MyModule) Example(ctx context.Context) []string  {
	return dag.
			Docker().
			RegistryAuthAddresses(ctx)
}
@function
async def example() -> List[str]:
	return await (
		dag.docker()
		.registry_auth_addresses()
	)
@func()
async example(): Promise<string[]> {
	return dag
		.docker()
		.registryAuthAddresses()
}

withRegistryAuth() 🔗

Configure registry authentication for later registry operations.

Return Type
Docker !
Arguments
NameTypeDefault ValueDescription
addressString !-Registry address to authenticate against
usernameString !-Registry username
passwordSecret !-Registry password or token secret
Example
dagger -m github.com/riftonix/daggerverse/modules/docker@8e5d9658ac5314d28f7f9a7bfbaa2deca5796f3e call \
 with-registry-auth --address string --username string --password env:MYSECRET
func (m *MyModule) Example(address string, username string, password *dagger.Secret) *dagger.Docker  {
	return dag.
			Docker().
			WithRegistryAuth(address, username, password)
}
@function
def example(address: str, username: str, password: dagger.Secret) -> dagger.Docker:
	return (
		dag.docker()
		.with_registry_auth(address, username, password)
	)
@func()
example(address: string, username: string, password: Secret): Docker {
	return dag
		.docker()
		.withRegistryAuth(address, username, password)
}

build() 🔗

Build a container image from a Dockerfile context.

Return Type
Build !
Arguments
NameTypeDefault ValueDescription
sourceDirectory -Source directory containing the Docker build context
contextPathString !"."Build context path relative to source
dockerfilePathString !"Dockerfile"Dockerfile path relative to context
targetString nullOptional Docker build target
buildArgs[String ! ] nullOptional build arguments in KEY=VALUE form
platforms[Scalar ! ] nullOptional target platforms
Example
dagger -m github.com/riftonix/daggerverse/modules/docker@8e5d9658ac5314d28f7f9a7bfbaa2deca5796f3e call \
 build --context-path string --dockerfile-path string
func (m *MyModule) Example(contextPath string, dockerfilePath string) *dagger.DockerBuild  {
	return dag.
			Docker().
			Build(contextPath, dockerfilePath)
}
@function
def example(context_path: str, dockerfile_path: str) -> dagger.DockerBuild:
	return (
		dag.docker()
		.build(context_path, dockerfile_path)
	)
@func()
example(contextPath: string, dockerfilePath: string): DockerBuild {
	return dag
		.docker()
		.build(contextPath, dockerfilePath)
}

image() 🔗

Create a Docker image result.

Return Type
Image !
Arguments
NameTypeDefault ValueDescription
imageRefString !-OCI image reference
Example
dagger -m github.com/riftonix/daggerverse/modules/docker@8e5d9658ac5314d28f7f9a7bfbaa2deca5796f3e call \
 image --image-ref string
func (m *MyModule) Example(imageRef string) *dagger.DockerImage  {
	return dag.
			Docker().
			Image(imageRef)
}
@function
def example(image_ref: str) -> dagger.DockerImage:
	return (
		dag.docker()
		.image(image_ref)
	)
@func()
example(imageRef: string): DockerImage {
	return dag
		.docker()
		.image(imageRef)
}