docker
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/act3-ai/daggerverse/docker@3e4f62b9a724889e2f4d673a7c99694aa54549cf
Entrypoint
Return Type
Docker !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
source | Directory | - | No description provided |
Example
dagger -m github.com/act3-ai/daggerverse/docker@3e4f62b9a724889e2f4d673a7c99694aa54549cf 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/daggerverse/docker@3e4f62b9a724889e2f4d673a7c99694aa54549cf 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/daggerverse/docker@3e4f62b9a724889e2f4d673a7c99694aa54549cf 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/daggerverse/docker@3e4f62b9a724889e2f4d673a7c99694aa54549cf 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/daggerverse/docker@3e4f62b9a724889e2f4d673a7c99694aa54549cf 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/daggerverse/docker@3e4f62b9a724889e2f4d673a7c99694aa54549cf 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)
}
withPublish() 🔗
publish with multiple tags to builds
Return Type
Docker !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
address | String ! | - | registry address to publish to |
tags | [String ! ] ! | - | comma separated list of tags to publish |
Example
dagger -m github.com/act3-ai/daggerverse/docker@3e4f62b9a724889e2f4d673a7c99694aa54549cf call \
with-publish --address string --tags string1 --tags string2
func (m *myModule) example(address string, tags []string) *dagger.Docker {
return dag.
Docker().
WithPublish(address, tags)
}
@function
def example(address: str, tags: List[str]) -> dagger.Docker:
return (
dag.docker()
.with_publish(address, tags)
)
@func()
example(address: string, tags: string[]): Docker {
return dag
.docker()
.withPublish(address, tags)
}
build() 🔗
Return Type
[String ! ] !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
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/daggerverse/docker@3e4f62b9a724889e2f4d673a7c99694aa54549cf call \
build
func (m *myModule) example(ctx context.Context, platforms []) []string {
return dag.
Docker().
Build(ctxplatforms)
}
@function
async def example(platforms: List[]) -> List[str]:
return await (
dag.docker()
.build(platforms)
)
@func()
async example(platforms: []): Promise<string[]> {
return dag
.docker()
.build(platforms)
}