dockerimage
Build and publish multi-platform images from Dockerfiles.
Installation
dagger install github.com/papercomputeco/daggerverse/dockerimage@822a736da394c1be12607134387efc760a71857eEntrypoint
Return Type
Dockerimage !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory | - | Build context. |
| dockerfile | String | "Dockerfile" | Dockerfile path relative to the build context. |
| platforms | [Scalar ! ] | - | Platforms included when publishing. |
Example
dagger -m github.com/papercomputeco/daggerverse/dockerimage@822a736da394c1be12607134387efc760a71857e call \
func (m *MyModule) Example() *dagger.Dockerimage {
return dag.
Dockerimage()
}@function
def example() -> dagger.Dockerimage:
return (
dag.dockerimage()
)@func()
example(): Dockerimage {
return dag
.dockerimage()
}Types
Dockerimage 🔗
Dockerimage builds and publishes a Dockerfile from a source directory.
build() 🔗
Build builds the image for the local platform, or for platform when provided.
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| platform | Scalar | - | Target platform, for example linux/arm64. |
Example
dagger -m github.com/papercomputeco/daggerverse/dockerimage@822a736da394c1be12607134387efc760a71857e call \
buildfunc (m *MyModule) Example() *dagger.Container {
return dag.
Dockerimage().
Build()
}@function
def example() -> dagger.Container:
return (
dag.dockerimage()
.build()
)@func()
example(): Container {
return dag
.dockerimage()
.build()
}publish() 🔗
Publish builds all configured platform variants and publishes each tag.
Return Type
[String ! ] !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| repository | String ! | - | Complete untagged repository, for example registry.example.com/team/app. |
| tags | [String ! ] ! | - | Tags to publish, for example [“v1.0.0”, “latest”]. |
Example
dagger -m github.com/papercomputeco/daggerverse/dockerimage@822a736da394c1be12607134387efc760a71857e call \
publish --repository string --tags string1 --tags string2func (m *MyModule) Example(ctx context.Context, repository string, tags []string) []string {
return dag.
Dockerimage().
Publish(ctx, repository, tags)
}@function
async def example(repository: str, tags: List[str]) -> List[str]:
return await (
dag.dockerimage()
.publish(repository, tags)
)@func()
async example(repository: string, tags: string[]): Promise<string[]> {
return dag
.dockerimage()
.publish(repository, tags)
}withBuildArg() 🔗
WithBuildArg adds a Docker build argument.
Return Type
Dockerimage !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| name | String ! | - | No description provided |
| value | String ! | - | No description provided |
Example
dagger -m github.com/papercomputeco/daggerverse/dockerimage@822a736da394c1be12607134387efc760a71857e call \
with-build-arg --name string --value stringfunc (m *MyModule) Example(name string, value string) *dagger.Dockerimage {
return dag.
Dockerimage().
Withbuildarg(name, value)
}@function
def example(name: str, value: str) -> dagger.Dockerimage:
return (
dag.dockerimage()
.withbuildarg(name, value)
)@func()
example(name: string, value: string): Dockerimage {
return dag
.dockerimage()
.withBuildArg(name, value)
}