docker
This module supports publishing with multiple registry/tag references along withproviding Docker secrets and Build Args.
Installation
dagger install github.com/act3-ai/dagger/docker@589309438d7c27fa812fe3b47f26b1a17ca4b43d
Entrypoint
Return Type
Docker !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
src | Directory | - | top level source code directory |
Example
dagger -m github.com/act3-ai/dagger/docker@589309438d7c27fa812fe3b47f26b1a17ca4b43d 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
Docker 🔗
withSecret() 🔗
Add a docker secret to builds
Return Type
Docker !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
name | String ! | - | name of the secret |
value | Secret ! | - | value of the secret |
Example
dagger -m github.com/act3-ai/dagger/docker@589309438d7c27fa812fe3b47f26b1a17ca4b43d call \
with-secret --name string --value env:MYSECRET
func (m *MyModule) Example(name string, value *dagger.Secret) *dagger.Docker {
return dag.
Docker().
WithSecret(name, value)
}
@function
def example(name: str, value: dagger.Secret) -> dagger.Docker:
return (
dag.docker()
.with_secret(name, value)
)
@func()
example(name: string, value: Secret): Docker {
return dag
.docker()
.withSecret(name, value)
}
withRegistryCreds() 🔗
Add docker registry creds to builds
Return Type
Docker !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
registry | String ! | - | name of the registry |
username | String ! | - | username for registry |
password | Secret ! | - | password for registry |
Example
dagger -m github.com/act3-ai/dagger/docker@589309438d7c27fa812fe3b47f26b1a17ca4b43d call \
with-registry-creds --registry string --username string --password env:MYSECRET
func (m *MyModule) Example(registry string, username string, password *dagger.Secret) *dagger.Docker {
return dag.
Docker().
WithRegistryCreds(registry, username, password)
}
@function
def example(registry: str, username: str, password: dagger.Secret) -> dagger.Docker:
return (
dag.docker()
.with_registry_creds(registry, username, password)
)
@func()
example(registry: string, username: string, password: Secret): Docker {
return dag
.docker()
.withRegistryCreds(registry, username, password)
}
withDockerConfig() 🔗
Add docker registry creds to builds
Return Type
Docker !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
file | File ! | - | file path to docker config json |
Example
dagger -m github.com/act3-ai/dagger/docker@589309438d7c27fa812fe3b47f26b1a17ca4b43d call \
with-docker-config --file file:path
func (m *MyModule) Example(file *dagger.File) *dagger.Docker {
return dag.
Docker().
WithDockerConfig(file)
}
@function
def example(file: dagger.File) -> dagger.Docker:
return (
dag.docker()
.with_docker_config(file)
)
@func()
example(file: File): Docker {
return dag
.docker()
.withDockerConfig(file)
}
withBuildArg() 🔗
Add docker build args to builds
Return Type
Docker !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
name | String ! | - | name of the secret |
value | String ! | - | value of the secret |
Example
dagger -m github.com/act3-ai/dagger/docker@589309438d7c27fa812fe3b47f26b1a17ca4b43d call \
with-build-arg --name string --value string
func (m *MyModule) Example(name string, value string) *dagger.Docker {
return dag.
Docker().
WithBuildArg(name, value)
}
@function
def example(name: str, value: str) -> dagger.Docker:
return (
dag.docker()
.with_build_arg(name, value)
)
@func()
example(name: string, value: string): Docker {
return dag
.docker()
.withBuildArg(name, value)
}
withLabel() 🔗
Add labels to builds
Return Type
Docker !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
name | String ! | - | name of the secret |
value | String ! | - | value of the secret |
Example
dagger -m github.com/act3-ai/dagger/docker@589309438d7c27fa812fe3b47f26b1a17ca4b43d call \
with-label --name string --value string
func (m *MyModule) Example(name string, value string) *dagger.Docker {
return dag.
Docker().
WithLabel(name, value)
}
@function
def example(name: str, value: str) -> dagger.Docker:
return (
dag.docker()
.with_label(name, value)
)
@func()
example(name: string, value: string): Docker {
return dag
.docker()
.withLabel(name, value)
}
build() 🔗
Build image from Dockerfile
Return Type
Container !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
target | String | "ci" | target stage of image build |
platform | Scalar ! | "linux/amd64" | platform to build with. value of [os]/[arch], example: linux/amd64, linux/arm64 |
Example
dagger -m github.com/act3-ai/dagger/docker@589309438d7c27fa812fe3b47f26b1a17ca4b43d call \
build
func (m *MyModule) Example(platform ) *dagger.Container {
return dag.
Docker().
Build(platform)
}
@function
def example(platform: ) -> dagger.Container:
return (
dag.docker()
.build(platform)
)
@func()
example(platform: ): Container {
return dag
.docker()
.build(platform)
}
publish() 🔗
Build a multi-arch image index from Dockerfile and Publish to an OCI registry, returning a slice of image digest references.
Return Type
[String ! ] !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
address | String ! | - | registry address to publish to, without tag |
tags | [String ! ] ! | - | comma separated list of tags to publish |
target | String | "ci" | target stage of image build |
platforms | [Scalar ! ] ! | ["linux/amd64"] | platforms to build with. value of [os]/[arch], example: linux/amd64, linux/arm64 |
Example
dagger -m github.com/act3-ai/dagger/docker@589309438d7c27fa812fe3b47f26b1a17ca4b43d call \
publish --address string --tags string1 --tags string2
func (m *MyModule) Example(ctx context.Context, address string, tags []string, platforms []) []string {
return dag.
Docker().
Publish(ctx, address, tags, platforms)
}
@function
async def example(address: str, tags: List[str], platforms: List[]) -> List[str]:
return await (
dag.docker()
.publish(address, tags, platforms)
)
@func()
async example(address: string, tags: string[], platforms: []): Promise<string[]> {
return dag
.docker()
.publish(address, tags, platforms)
}