docker
Dagger-native Docker and OCI image helpers.
Installation
dagger install github.com/riftonix/daggerverse/modules/docker@5349e13953f3bcbeffeb710c1ba6f5cb4b958a5eEntrypoint
Return Type
RegistryAuth !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| address | String ! | - | No description provided |
| username | String ! | - | No description provided |
| password | Secret ! | - | No description provided |
Example
Function RegistryAuth.Constructor is not accessible from the docker moduleFunction RegistryAuth.Constructor is not accessible from the docker moduleFunction RegistryAuth.Constructor is not accessible from the docker moduleFunction RegistryAuth.Constructor is not accessible from the docker moduleEntrypoint
Return Type
Build !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| container | Container ! | - | No description provided |
| contextPath | String ! | - | No description provided |
| dockerfilePath | String ! | - | No description provided |
| target | String | - | No description provided |
| buildArgs | [String ! ] ! | - | No description provided |
| platforms | [Scalar ! ] ! | - | No description provided |
| platformVariants | [Container ! ] ! | - | No description provided |
| registryAuths | [RegistryAuth ! ] | null | No description provided |
| publishDryRun | Boolean ! | false | No description provided |
Example
Function Build.Constructor is not accessible from the docker moduleFunction Build.Constructor is not accessible from the docker moduleFunction Build.Constructor is not accessible from the docker moduleFunction Build.Constructor is not accessible from the docker moduleEntrypoint
Return Type
Image !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| imageRef | String ! | - | No description provided |
| imageRefs | [String ! ] | null | No description provided |
Example
Function Image.Constructor is not accessible from the docker moduleFunction Image.Constructor is not accessible from the docker moduleFunction Image.Constructor is not accessible from the docker moduleFunction Image.Constructor is not accessible from the docker moduleEntrypoint
Return Type
Docker !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| registryAuths | [RegistryAuth ! ] | null | No description provided |
Example
dagger -m github.com/riftonix/daggerverse/modules/docker@5349e13953f3bcbeffeb710c1ba6f5cb4b958a5e 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 moduleFunction DockerRegistryAuth.address is not accessible from the docker moduleFunction DockerRegistryAuth.address is not accessible from the docker moduleFunction DockerRegistryAuth.address is not accessible from the docker moduleusername() 🔗
Return the registry username.
Return Type
String ! Example
Function DockerRegistryAuth.username is not accessible from the docker moduleFunction DockerRegistryAuth.username is not accessible from the docker moduleFunction DockerRegistryAuth.username is not accessible from the docker moduleFunction DockerRegistryAuth.username is not accessible from the docker moduleBuild 🔗
Container image build result.
container() 🔗
Return the built container.
Return Type
Container ! Example
dagger -m github.com/riftonix/daggerverse/modules/docker@5349e13953f3bcbeffeb710c1ba6f5cb4b958a5e call \
build --context-path string --dockerfile-path string \
containerfunc (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@5349e13953f3bcbeffeb710c1ba6f5cb4b958a5e call \
build --context-path string --dockerfile-path string \
context-pathfunc (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@5349e13953f3bcbeffeb710c1ba6f5cb4b958a5e call \
build --context-path string --dockerfile-path string \
dockerfile-pathfunc (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@5349e13953f3bcbeffeb710c1ba6f5cb4b958a5e call \
build --context-path string --dockerfile-path string \
targetfunc (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@5349e13953f3bcbeffeb710c1ba6f5cb4b958a5e call \
build --context-path string --dockerfile-path string \
build-argsfunc (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@5349e13953f3bcbeffeb710c1ba6f5cb4b958a5e call \
build --context-path string --dockerfile-path string \
platformsfunc (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@5349e13953f3bcbeffeb710c1ba6f5cb4b958a5e call \
build --context-path string --dockerfile-path string \
platform-variantsfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| command | [String ! ] ! | - | Command to run in the built container |
Example
dagger -m github.com/riftonix/daggerverse/modules/docker@5349e13953f3bcbeffeb710c1ba6f5cb4b958a5e call \
build --context-path string --dockerfile-path string \
with-smoke-check --command string1 --command string2func (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@5349e13953f3bcbeffeb710c1ba6f5cb4b958a5e call \
build --context-path string --dockerfile-path string \
with-publish-dry-runfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| imageRefs | [String ! ] ! | - | OCI image references to publish |
Example
dagger -m github.com/riftonix/daggerverse/modules/docker@5349e13953f3bcbeffeb710c1ba6f5cb4b958a5e call \
build --context-path string --dockerfile-path string \
publish --image-refs string1 --image-refs string2func (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@5349e13953f3bcbeffeb710c1ba6f5cb4b958a5e call \
image --image-ref string \
image-reffunc (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@5349e13953f3bcbeffeb710c1ba6f5cb4b958a5e call \
image --image-ref string \
image-refsfunc (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@5349e13953f3bcbeffeb710c1ba6f5cb4b958a5e call \
modulefunc (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@5349e13953f3bcbeffeb710c1ba6f5cb4b958a5e call \
registry-auth-addressesfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| address | String ! | - | Registry address to authenticate against |
| username | String ! | - | Registry username |
| password | Secret ! | - | Registry password or token secret |
Example
dagger -m github.com/riftonix/daggerverse/modules/docker@5349e13953f3bcbeffeb710c1ba6f5cb4b958a5e call \
with-registry-auth --address string --username string --password env:MYSECRETfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory | - | Source directory containing the Docker build context |
| contextPath | String ! | "." | Build context path relative to source |
| dockerfilePath | String ! | "Dockerfile" | Dockerfile path relative to context |
| target | String | null | Optional Docker build target |
| buildArgs | [String ! ] | null | Optional build arguments in KEY=VALUE form |
| platforms | [Scalar ! ] | null | Optional target platforms |
Example
dagger -m github.com/riftonix/daggerverse/modules/docker@5349e13953f3bcbeffeb710c1ba6f5cb4b958a5e call \
build --context-path string --dockerfile-path stringfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| imageRef | String ! | - | OCI image reference |
Example
dagger -m github.com/riftonix/daggerverse/modules/docker@5349e13953f3bcbeffeb710c1ba6f5cb4b958a5e call \
image --image-ref stringfunc (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)
}