docker
Build, publish, scan and sign multi-platform Docker images.
Installation
dagger install github.com/opopops/daggerverse/docker@214e3fb2a439c5a138edfd4c03fbe4d9b854bf1f
Entrypoint
Return Type
Docker !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
registry | String | "index.docker.io" | No description provided |
username | String | null | No description provided |
password | Secret | null | No description provided |
Example
dagger -m github.com/opopops/daggerverse/docker@214e3fb2a439c5a138edfd4c03fbe4d9b854bf1f call \
func (m *myModule) example() *Docker {
return dag.
Docker()
}
@function
def example() -> dag.Docker:
return (
dag.docker()
)
@func()
example(): Docker {
return dag
.docker()
}
Types
Image 🔗
Docker Image
registryUsername() 🔗
Return Type
String
Example
dagger -m github.com/opopops/daggerverse/docker@214e3fb2a439c5a138edfd4c03fbe4d9b854bf1f call \
build --context DIR_PATH \
publish --image string \
registry-username
func (m *myModule) example(ctx context.Context, context *Directory, platform [], image string) string {
return dag.
Docker().
Build(context, platform).
Publish(image).
RegistryUsername(ctx)
}
@function
async def example(context: dagger.Directory, platform: List[], image: str) -> str:
return await (
dag.docker()
.build(context, platform)
.publish(image)
.registry_username()
)
@func()
async example(context: Directory, platform: [], image: string): Promise<string> {
return dag
.docker()
.build(context, platform)
.publish(image)
.registryUsername()
}
registryPassword() 🔗
Return Type
Secret
Example
dagger -m github.com/opopops/daggerverse/docker@214e3fb2a439c5a138edfd4c03fbe4d9b854bf1f call \
build --context DIR_PATH \
publish --image string \
registry-password
func (m *myModule) example(context *Directory, platform [], image string) *Secret {
return dag.
Docker().
Build(context, platform).
Publish(image).
RegistryPassword()
}
@function
def example(context: dagger.Directory, platform: List[], image: str) -> dagger.Secret:
return (
dag.docker()
.build(context, platform)
.publish(image)
.registry_password()
)
@func()
example(context: Directory, platform: [], image: string): Secret {
return dag
.docker()
.build(context, platform)
.publish(image)
.registryPassword()
}
container() 🔗
Return Type
Container
Example
dagger -m github.com/opopops/daggerverse/docker@214e3fb2a439c5a138edfd4c03fbe4d9b854bf1f call \
build --context DIR_PATH \
publish --image string \
container
func (m *myModule) example(context *Directory, platform [], image string) *Container {
return dag.
Docker().
Build(context, platform).
Publish(image).
Container()
}
@function
def example(context: dagger.Directory, platform: List[], image: str) -> dagger.Container:
return (
dag.docker()
.build(context, platform)
.publish(image)
.container()
)
@func()
example(context: Directory, platform: [], image: string): Container {
return dag
.docker()
.build(context, platform)
.publish(image)
.container()
}
platforms() 🔗
Retrieves image platforms
Return Type
[Scalar ! ] !
Example
dagger -m github.com/opopops/daggerverse/docker@214e3fb2a439c5a138edfd4c03fbe4d9b854bf1f call \
build --context DIR_PATH \
publish --image string \
platforms
func (m *myModule) example(context *Directory, platform [], image string) [] {
return dag.
Docker().
Build(context, platform).
Publish(image).
Platforms()
}
@function
def example(context: dagger.Directory, platform: List[], image: str) -> List[]:
return (
dag.docker()
.build(context, platform)
.publish(image)
.platforms()
)
@func()
example(context: Directory, platform: [], image: string): [] {
return dag
.docker()
.build(context, platform)
.publish(image)
.platforms()
}
ref() 🔗
Retrieves the fully qualified image ref
Return Type
String !
Example
dagger -m github.com/opopops/daggerverse/docker@214e3fb2a439c5a138edfd4c03fbe4d9b854bf1f call \
build --context DIR_PATH \
publish --image string \
ref
func (m *myModule) example(ctx context.Context, context *Directory, platform [], image string) string {
return dag.
Docker().
Build(context, platform).
Publish(image).
Ref(ctx)
}
@function
async def example(context: dagger.Directory, platform: List[], image: str) -> str:
return await (
dag.docker()
.build(context, platform)
.publish(image)
.ref()
)
@func()
async example(context: Directory, platform: [], image: string): Promise<string> {
return dag
.docker()
.build(context, platform)
.publish(image)
.ref()
}
digest() 🔗
Retrieves the image digest
Return Type
String !
Example
dagger -m github.com/opopops/daggerverse/docker@214e3fb2a439c5a138edfd4c03fbe4d9b854bf1f call \
build --context DIR_PATH \
publish --image string \
digest
func (m *myModule) example(ctx context.Context, context *Directory, platform [], image string) string {
return dag.
Docker().
Build(context, platform).
Publish(image).
Digest(ctx)
}
@function
async def example(context: dagger.Directory, platform: List[], image: str) -> str:
return await (
dag.docker()
.build(context, platform)
.publish(image)
.digest()
)
@func()
async example(context: Directory, platform: [], image: string): Promise<string> {
return dag
.docker()
.build(context, platform)
.publish(image)
.digest()
}
registry() 🔗
Retrieves the registry host from image address
Return Type
String !
Example
dagger -m github.com/opopops/daggerverse/docker@214e3fb2a439c5a138edfd4c03fbe4d9b854bf1f call \
build --context DIR_PATH \
publish --image string \
registry
func (m *myModule) example(ctx context.Context, context *Directory, platform [], image string) string {
return dag.
Docker().
Build(context, platform).
Publish(image).
Registry(ctx)
}
@function
async def example(context: dagger.Directory, platform: List[], image: str) -> str:
return await (
dag.docker()
.build(context, platform)
.publish(image)
.registry()
)
@func()
async example(context: Directory, platform: [], image: string): Promise<string> {
return dag
.docker()
.build(context, platform)
.publish(image)
.registry()
}
tag() 🔗
Tag image
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
tag | String ! | - | Tag |
Example
dagger -m github.com/opopops/daggerverse/docker@214e3fb2a439c5a138edfd4c03fbe4d9b854bf1f call \
build --context DIR_PATH \
publish --image string \
tag --tag string
func (m *myModule) example(ctx context.Context, context *Directory, platform [], image string, tag string) string {
return dag.
Docker().
Build(context, platform).
Publish(image).
Tag(ctx, tag)
}
@function
async def example(context: dagger.Directory, platform: List[], image: str, tag: str) -> str:
return await (
dag.docker()
.build(context, platform)
.publish(image)
.tag(tag)
)
@func()
async example(context: Directory, platform: [], image: string, tag: string): Promise<string> {
return dag
.docker()
.build(context, platform)
.publish(image)
.tag(tag)
}
withTag() 🔗
Tag image (for chaining)
Return Type
Image !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
tag | String ! | - | Tag |
Example
dagger -m github.com/opopops/daggerverse/docker@214e3fb2a439c5a138edfd4c03fbe4d9b854bf1f call \
build --context DIR_PATH \
publish --image string \
with-tag --tag string
func (m *myModule) example(context *Directory, platform [], image string, tag string) *DockerImage {
return dag.
Docker().
Build(context, platform).
Publish(image).
WithTag(tag)
}
@function
def example(context: dagger.Directory, platform: List[], image: str, tag: str) -> dag.DockerImage:
return (
dag.docker()
.build(context, platform)
.publish(image)
.with_tag(tag)
)
@func()
example(context: Directory, platform: [], image: string, tag: string): DockerImage {
return dag
.docker()
.build(context, platform)
.publish(image)
.withTag(tag)
}
scan() 🔗
Scan image using Grype
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
failOn | String | null | No description provided |
outputFormat | String ! | "table" | Report output formatter |
output | String | null | No description provided |
Example
dagger -m github.com/opopops/daggerverse/docker@214e3fb2a439c5a138edfd4c03fbe4d9b854bf1f call \
build --context DIR_PATH \
publish --image string \
scan --output-format string
func (m *myModule) example(ctx context.Context, context *Directory, platform [], image string, outputFormat string) string {
return dag.
Docker().
Build(context, platform).
Publish(image).
Scan(ctxoutputFormat)
}
@function
async def example(context: dagger.Directory, platform: List[], image: str, output_format: str) -> str:
return await (
dag.docker()
.build(context, platform)
.publish(image)
.scan(output_format)
)
@func()
async example(context: Directory, platform: [], image: string, outputFormat: string): Promise<string> {
return dag
.docker()
.build(context, platform)
.publish(image)
.scan(outputFormat)
}
withScan() 🔗
Scan image using Grype (for chaining)
Return Type
Image !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
failOn | String | null | No description provided |
outputFormat | String ! | "table" | Report output formatter |
output | String | null | No description provided |
Example
dagger -m github.com/opopops/daggerverse/docker@214e3fb2a439c5a138edfd4c03fbe4d9b854bf1f call \
build --context DIR_PATH \
publish --image string \
with-scan --output-format string
func (m *myModule) example(context *Directory, platform [], image string, outputFormat string) *DockerImage {
return dag.
Docker().
Build(context, platform).
Publish(image).
WithScan(outputFormat)
}
@function
def example(context: dagger.Directory, platform: List[], image: str, output_format: str) -> dag.DockerImage:
return (
dag.docker()
.build(context, platform)
.publish(image)
.with_scan(output_format)
)
@func()
example(context: Directory, platform: [], image: string, outputFormat: string): DockerImage {
return dag
.docker()
.build(context, platform)
.publish(image)
.withScan(outputFormat)
}
sign() 🔗
Sign image with Cosign
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
privateKey | Secret ! | - | Cosign private key |
password | Secret ! | - | Cosign password |
recursive | Boolean | true | No description provided |
Example
dagger -m github.com/opopops/daggerverse/docker@214e3fb2a439c5a138edfd4c03fbe4d9b854bf1f call \
build --context DIR_PATH \
publish --image string \
sign --private-key env:MYSECRET --password env:MYSECRET
func (m *myModule) example(ctx context.Context, context *Directory, platform [], image string, privateKey *Secret, password *Secret) string {
return dag.
Docker().
Build(context, platform).
Publish(image).
Sign(ctx, privateKey, password)
}
@function
async def example(context: dagger.Directory, platform: List[], image: str, private_key: dagger.Secret, password: dagger.Secret) -> str:
return await (
dag.docker()
.build(context, platform)
.publish(image)
.sign(private_key, password)
)
@func()
async example(context: Directory, platform: [], image: string, privateKey: Secret, password: Secret): Promise<string> {
return dag
.docker()
.build(context, platform)
.publish(image)
.sign(privateKey, password)
}
withSign() 🔗
Sign image with Cosign (for chaining)
Return Type
Image !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
privateKey | Secret ! | - | Cosign private key |
password | Secret ! | - | Cosign password |
recursive | Boolean | true | No description provided |
Example
dagger -m github.com/opopops/daggerverse/docker@214e3fb2a439c5a138edfd4c03fbe4d9b854bf1f call \
build --context DIR_PATH \
publish --image string \
with-sign --private-key env:MYSECRET --password env:MYSECRET
func (m *myModule) example(context *Directory, platform [], image string, privateKey *Secret, password *Secret) *DockerImage {
return dag.
Docker().
Build(context, platform).
Publish(image).
WithSign(privateKey, password)
}
@function
def example(context: dagger.Directory, platform: List[], image: str, private_key: dagger.Secret, password: dagger.Secret) -> dag.DockerImage:
return (
dag.docker()
.build(context, platform)
.publish(image)
.with_sign(private_key, password)
)
@func()
example(context: Directory, platform: [], image: string, privateKey: Secret, password: Secret): DockerImage {
return dag
.docker()
.build(context, platform)
.publish(image)
.withSign(privateKey, password)
}
Build 🔗
Docker Build
registry() 🔗
Return Type
String
Example
dagger -m github.com/opopops/daggerverse/docker@214e3fb2a439c5a138edfd4c03fbe4d9b854bf1f call \
build --context DIR_PATH \
registry
func (m *myModule) example(ctx context.Context, context *Directory, platform []) string {
return dag.
Docker().
Build(context, platform).
Registry(ctx)
}
@function
async def example(context: dagger.Directory, platform: List[]) -> str:
return await (
dag.docker()
.build(context, platform)
.registry()
)
@func()
async example(context: Directory, platform: []): Promise<string> {
return dag
.docker()
.build(context, platform)
.registry()
}
registryUsername() 🔗
Return Type
String
Example
dagger -m github.com/opopops/daggerverse/docker@214e3fb2a439c5a138edfd4c03fbe4d9b854bf1f call \
build --context DIR_PATH \
registry-username
func (m *myModule) example(ctx context.Context, context *Directory, platform []) string {
return dag.
Docker().
Build(context, platform).
RegistryUsername(ctx)
}
@function
async def example(context: dagger.Directory, platform: List[]) -> str:
return await (
dag.docker()
.build(context, platform)
.registry_username()
)
@func()
async example(context: Directory, platform: []): Promise<string> {
return dag
.docker()
.build(context, platform)
.registryUsername()
}
registryPassword() 🔗
Return Type
Secret
Example
dagger -m github.com/opopops/daggerverse/docker@214e3fb2a439c5a138edfd4c03fbe4d9b854bf1f call \
build --context DIR_PATH \
registry-password
func (m *myModule) example(context *Directory, platform []) *Secret {
return dag.
Docker().
Build(context, platform).
RegistryPassword()
}
@function
def example(context: dagger.Directory, platform: List[]) -> dagger.Secret:
return (
dag.docker()
.build(context, platform)
.registry_password()
)
@func()
example(context: Directory, platform: []): Secret {
return dag
.docker()
.build(context, platform)
.registryPassword()
}
container() 🔗
Return Type
Container !
Example
dagger -m github.com/opopops/daggerverse/docker@214e3fb2a439c5a138edfd4c03fbe4d9b854bf1f call \
build --context DIR_PATH \
container
func (m *myModule) example(context *Directory, platform []) *Container {
return dag.
Docker().
Build(context, platform).
Container()
}
@function
def example(context: dagger.Directory, platform: List[]) -> dagger.Container:
return (
dag.docker()
.build(context, platform)
.container()
)
@func()
example(context: Directory, platform: []): Container {
return dag
.docker()
.build(context, platform)
.container()
}
asTarball() 🔗
Export build as tarball
Return Type
File !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
compress | Boolean | false | No description provided |
Example
dagger -m github.com/opopops/daggerverse/docker@214e3fb2a439c5a138edfd4c03fbe4d9b854bf1f call \
build --context DIR_PATH \
as-tarball
func (m *myModule) example(context *Directory, platform []) *File {
return dag.
Docker().
Build(context, platform).
AsTarball()
}
@function
def example(context: dagger.Directory, platform: List[]) -> dagger.File:
return (
dag.docker()
.build(context, platform)
.as_tarball()
)
@func()
example(context: Directory, platform: []): File {
return dag
.docker()
.build(context, platform)
.asTarball()
}
scan() 🔗
Scan build result using Grype
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
failOn | String | null | No description provided |
outputFormat | String ! | "table" | Report output formatter |
output | String | null | No description provided |
Example
dagger -m github.com/opopops/daggerverse/docker@214e3fb2a439c5a138edfd4c03fbe4d9b854bf1f call \
build --context DIR_PATH \
scan --output-format string
func (m *myModule) example(ctx context.Context, context *Directory, platform [], outputFormat string) string {
return dag.
Docker().
Build(context, platform).
Scan(ctxoutputFormat)
}
@function
async def example(context: dagger.Directory, platform: List[], output_format: str) -> str:
return await (
dag.docker()
.build(context, platform)
.scan(output_format)
)
@func()
async example(context: Directory, platform: [], outputFormat: string): Promise<string> {
return dag
.docker()
.build(context, platform)
.scan(outputFormat)
}
withScan() 🔗
Scan build result using Grype (for chaining)
Return Type
Build !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
failOn | String | null | No description provided |
outputFormat | String ! | "table" | Report output formatter |
output | String | null | No description provided |
Example
dagger -m github.com/opopops/daggerverse/docker@214e3fb2a439c5a138edfd4c03fbe4d9b854bf1f call \
build --context DIR_PATH \
with-scan --output-format string
func (m *myModule) example(context *Directory, platform [], outputFormat string) *DockerBuild {
return dag.
Docker().
Build(context, platform).
WithScan(outputFormat)
}
@function
def example(context: dagger.Directory, platform: List[], output_format: str) -> dag.DockerBuild:
return (
dag.docker()
.build(context, platform)
.with_scan(output_format)
)
@func()
example(context: Directory, platform: [], outputFormat: string): DockerBuild {
return dag
.docker()
.build(context, platform)
.withScan(outputFormat)
}
publish() 🔗
Publish multi-arch image
Return Type
Image !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
image | String ! | - | Image tags |
Example
dagger -m github.com/opopops/daggerverse/docker@214e3fb2a439c5a138edfd4c03fbe4d9b854bf1f call \
build --context DIR_PATH \
publish --image string
func (m *myModule) example(context *Directory, platform [], image string) *DockerImage {
return dag.
Docker().
Build(context, platform).
Publish(image)
}
@function
def example(context: dagger.Directory, platform: List[], image: str) -> dag.DockerImage:
return (
dag.docker()
.build(context, platform)
.publish(image)
)
@func()
example(context: Directory, platform: [], image: string): DockerImage {
return dag
.docker()
.build(context, platform)
.publish(image)
}
Docker 🔗
Docker CLI
registry() 🔗
Return Type
String
Example
dagger -m github.com/opopops/daggerverse/docker@214e3fb2a439c5a138edfd4c03fbe4d9b854bf1f call \
registry
func (m *myModule) example(ctx context.Context) string {
return dag.
Docker().
Registry(ctx)
}
@function
async def example() -> str:
return await (
dag.docker()
.registry()
)
@func()
async example(): Promise<string> {
return dag
.docker()
.registry()
}
username() 🔗
Return Type
String
Example
dagger -m github.com/opopops/daggerverse/docker@214e3fb2a439c5a138edfd4c03fbe4d9b854bf1f call \
username
func (m *myModule) example(ctx context.Context) string {
return dag.
Docker().
Username(ctx)
}
@function
async def example() -> str:
return await (
dag.docker()
.username()
)
@func()
async example(): Promise<string> {
return dag
.docker()
.username()
}
password() 🔗
Return Type
Secret
Example
dagger -m github.com/opopops/daggerverse/docker@214e3fb2a439c5a138edfd4c03fbe4d9b854bf1f call \
password
func (m *myModule) example() *Secret {
return dag.
Docker().
Password()
}
@function
def example() -> dagger.Secret:
return (
dag.docker()
.password()
)
@func()
example(): Secret {
return dag
.docker()
.password()
}
build() 🔗
Build multi-arch Docker image
Return Type
Build !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
context | Directory ! | - | Dockerfile context |
platform | [Scalar ! ] ! | - | Set target platform for build |
dockerfile | String | "Dockerfile" | No description provided |
target | String | "" | No description provided |
secrets | [Secret ! ] | null | No description provided |
Example
dagger -m github.com/opopops/daggerverse/docker@214e3fb2a439c5a138edfd4c03fbe4d9b854bf1f call \
build --context DIR_PATH
func (m *myModule) example(context *Directory, platform []) *DockerBuild {
return dag.
Docker().
Build(context, platform)
}
@function
def example(context: dagger.Directory, platform: List[]) -> dag.DockerBuild:
return (
dag.docker()
.build(context, platform)
)
@func()
example(context: Directory, platform: []): DockerBuild {
return dag
.docker()
.build(context, platform)
}