docker
Build, publish, scan and sign multi-platform Docker images.
Installation
dagger install github.com/opopops/daggerverse/docker@v1.2.1Entrypoint
Return Type
Docker !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| registry | String | "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@327a52a86fa82c8a28102a10c27acac1525686a0 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
Image 🔗
Docker Image
username() 🔗
Return Type
String Example
dagger -m github.com/opopops/daggerverse/docker@327a52a86fa82c8a28102a10c27acac1525686a0 call \
build --context DIR_PATH --file string --target string --build-arg string1 --build-arg string2 \
publish --image string \
usernamefunc (m *MyModule) Example(ctx context.Context, context *dagger.Directory, platform [], file string, target string, buildArg []string, secret []*dagger.Secret, image string) string {
return dag.
Docker().
Build(context, platform, file, target, buildArg, secret).
Publish(image).
Username(ctx)
}@function
async def example(context: dagger.Directory, platform: List[], file: str, target: str, build_arg: List[str], secret: List[dagger.Secret], image: str) -> str:
return await (
dag.docker()
.build(context, platform, file, target, build_arg, secret)
.publish(image)
.username()
)@func()
async example(context: Directory, platform: [], file: string, target: string, buildArg: string[], secret: Secret[], image: string): Promise<string> {
return dag
.docker()
.build(context, platform, file, target, buildArg, secret)
.publish(image)
.username()
}password() 🔗
Return Type
Secret Example
dagger -m github.com/opopops/daggerverse/docker@327a52a86fa82c8a28102a10c27acac1525686a0 call \
build --context DIR_PATH --file string --target string --build-arg string1 --build-arg string2 \
publish --image string \
passwordfunc (m *MyModule) Example(context *dagger.Directory, platform [], file string, target string, buildArg []string, secret []*dagger.Secret, image string) *dagger.Secret {
return dag.
Docker().
Build(context, platform, file, target, buildArg, secret).
Publish(image).
Password()
}@function
def example(context: dagger.Directory, platform: List[], file: str, target: str, build_arg: List[str], secret: List[dagger.Secret], image: str) -> dagger.Secret:
return (
dag.docker()
.build(context, platform, file, target, build_arg, secret)
.publish(image)
.password()
)@func()
example(context: Directory, platform: [], file: string, target: string, buildArg: string[], secret: Secret[], image: string): Secret {
return dag
.docker()
.build(context, platform, file, target, buildArg, secret)
.publish(image)
.password()
}container() 🔗
Returns authenticated container
Return Type
Container ! Example
dagger -m github.com/opopops/daggerverse/docker@327a52a86fa82c8a28102a10c27acac1525686a0 call \
build --context DIR_PATH --file string --target string --build-arg string1 --build-arg string2 \
publish --image string \
containerfunc (m *MyModule) Example(context *dagger.Directory, platform [], file string, target string, buildArg []string, secret []*dagger.Secret, image string) *dagger.Container {
return dag.
Docker().
Build(context, platform, file, target, buildArg, secret).
Publish(image).
Container()
}@function
def example(context: dagger.Directory, platform: List[], file: str, target: str, build_arg: List[str], secret: List[dagger.Secret], image: str) -> dagger.Container:
return (
dag.docker()
.build(context, platform, file, target, build_arg, secret)
.publish(image)
.container()
)@func()
example(context: Directory, platform: [], file: string, target: string, buildArg: string[], secret: Secret[], image: string): Container {
return dag
.docker()
.build(context, platform, file, target, buildArg, secret)
.publish(image)
.container()
}digest() 🔗
Retrieves the image digest
Return Type
String ! Example
dagger -m github.com/opopops/daggerverse/docker@327a52a86fa82c8a28102a10c27acac1525686a0 call \
build --context DIR_PATH --file string --target string --build-arg string1 --build-arg string2 \
publish --image string \
digestfunc (m *MyModule) Example(ctx context.Context, context *dagger.Directory, platform [], file string, target string, buildArg []string, secret []*dagger.Secret, image string) string {
return dag.
Docker().
Build(context, platform, file, target, buildArg, secret).
Publish(image).
Digest(ctx)
}@function
async def example(context: dagger.Directory, platform: List[], file: str, target: str, build_arg: List[str], secret: List[dagger.Secret], image: str) -> str:
return await (
dag.docker()
.build(context, platform, file, target, build_arg, secret)
.publish(image)
.digest()
)@func()
async example(context: Directory, platform: [], file: string, target: string, buildArg: string[], secret: Secret[], image: string): Promise<string> {
return dag
.docker()
.build(context, platform, file, target, buildArg, secret)
.publish(image)
.digest()
}platforms() 🔗
Retrieves image platforms
Return Type
[Scalar ! ] ! Example
dagger -m github.com/opopops/daggerverse/docker@327a52a86fa82c8a28102a10c27acac1525686a0 call \
build --context DIR_PATH --file string --target string --build-arg string1 --build-arg string2 \
publish --image string \
platformsfunc (m *MyModule) Example(context *dagger.Directory, platform [], file string, target string, buildArg []string, secret []*dagger.Secret, image string) [] {
return dag.
Docker().
Build(context, platform, file, target, buildArg, secret).
Publish(image).
Platforms()
}@function
def example(context: dagger.Directory, platform: List[], file: str, target: str, build_arg: List[str], secret: List[dagger.Secret], image: str) -> List[]:
return (
dag.docker()
.build(context, platform, file, target, build_arg, secret)
.publish(image)
.platforms()
)@func()
example(context: Directory, platform: [], file: string, target: string, buildArg: string[], secret: Secret[], image: string): [] {
return dag
.docker()
.build(context, platform, file, target, buildArg, secret)
.publish(image)
.platforms()
}ref() 🔗
Retrieves the fully qualified image ref
Return Type
String ! Example
dagger -m github.com/opopops/daggerverse/docker@327a52a86fa82c8a28102a10c27acac1525686a0 call \
build --context DIR_PATH --file string --target string --build-arg string1 --build-arg string2 \
publish --image string \
reffunc (m *MyModule) Example(ctx context.Context, context *dagger.Directory, platform [], file string, target string, buildArg []string, secret []*dagger.Secret, image string) string {
return dag.
Docker().
Build(context, platform, file, target, buildArg, secret).
Publish(image).
Ref(ctx)
}@function
async def example(context: dagger.Directory, platform: List[], file: str, target: str, build_arg: List[str], secret: List[dagger.Secret], image: str) -> str:
return await (
dag.docker()
.build(context, platform, file, target, build_arg, secret)
.publish(image)
.ref()
)@func()
async example(context: Directory, platform: [], file: string, target: string, buildArg: string[], secret: Secret[], image: string): Promise<string> {
return dag
.docker()
.build(context, platform, file, target, buildArg, secret)
.publish(image)
.ref()
}registry() 🔗
Retrieves the registry host from image address
Return Type
String ! Example
dagger -m github.com/opopops/daggerverse/docker@327a52a86fa82c8a28102a10c27acac1525686a0 call \
build --context DIR_PATH --file string --target string --build-arg string1 --build-arg string2 \
publish --image string \
registryfunc (m *MyModule) Example(ctx context.Context, context *dagger.Directory, platform [], file string, target string, buildArg []string, secret []*dagger.Secret, image string) string {
return dag.
Docker().
Build(context, platform, file, target, buildArg, secret).
Publish(image).
Registry(ctx)
}@function
async def example(context: dagger.Directory, platform: List[], file: str, target: str, build_arg: List[str], secret: List[dagger.Secret], image: str) -> str:
return await (
dag.docker()
.build(context, platform, file, target, build_arg, secret)
.publish(image)
.registry()
)@func()
async example(context: Directory, platform: [], file: string, target: string, buildArg: string[], secret: Secret[], image: string): Promise<string> {
return dag
.docker()
.build(context, platform, file, target, buildArg, secret)
.publish(image)
.registry()
}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 |
Example
dagger -m github.com/opopops/daggerverse/docker@327a52a86fa82c8a28102a10c27acac1525686a0 call \
build --context DIR_PATH --file string --target string --build-arg string1 --build-arg string2 \
publish --image string \
scan --output-format stringfunc (m *MyModule) Example(ctx context.Context, context *dagger.Directory, platform [], file string, target string, buildArg []string, secret []*dagger.Secret, image string, outputFormat string) string {
return dag.
Docker().
Build(context, platform, file, target, buildArg, secret).
Publish(image).
Scan(ctxoutputFormat)
}@function
async def example(context: dagger.Directory, platform: List[], file: str, target: str, build_arg: List[str], secret: List[dagger.Secret], image: str, output_format: str) -> str:
return await (
dag.docker()
.build(context, platform, file, target, build_arg, secret)
.publish(image)
.scan(output_format)
)@func()
async example(context: Directory, platform: [], file: string, target: string, buildArg: string[], secret: Secret[], image: string, outputFormat: string): Promise<string> {
return dag
.docker()
.build(context, platform, file, target, buildArg, secret)
.publish(image)
.scan(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 | If a multi-arch image is specified, additionally sign each discrete image |
Example
dagger -m github.com/opopops/daggerverse/docker@327a52a86fa82c8a28102a10c27acac1525686a0 call \
build --context DIR_PATH --file string --target string --build-arg string1 --build-arg string2 \
publish --image string \
sign --private-key env:MYSECRET --password env:MYSECRET --recursive booleanfunc (m *MyModule) Example(ctx context.Context, context *dagger.Directory, platform [], file string, target string, buildArg []string, secret []*dagger.Secret, image string, privateKey *dagger.Secret, password *dagger.Secret, recursive bool) string {
return dag.
Docker().
Build(context, platform, file, target, buildArg, secret).
Publish(image).
Sign(ctx, privateKey, password, recursive)
}@function
async def example(context: dagger.Directory, platform: List[], file: str, target: str, build_arg: List[str], secret: List[dagger.Secret], image: str, private_key: dagger.Secret, password: dagger.Secret, recursive: bool) -> str:
return await (
dag.docker()
.build(context, platform, file, target, build_arg, secret)
.publish(image)
.sign(private_key, password, recursive)
)@func()
async example(context: Directory, platform: [], file: string, target: string, buildArg: string[], secret: Secret[], image: string, privateKey: Secret, password: Secret, recursive: boolean): Promise<string> {
return dag
.docker()
.build(context, platform, file, target, buildArg, secret)
.publish(image)
.sign(privateKey, password, recursive)
}tag() 🔗
Tag image
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| tag | String ! | - | Tag |
Example
dagger -m github.com/opopops/daggerverse/docker@327a52a86fa82c8a28102a10c27acac1525686a0 call \
build --context DIR_PATH --file string --target string --build-arg string1 --build-arg string2 \
publish --image string \
tag --tag stringfunc (m *MyModule) Example(ctx context.Context, context *dagger.Directory, platform [], file string, target string, buildArg []string, secret []*dagger.Secret, image string, tag string) string {
return dag.
Docker().
Build(context, platform, file, target, buildArg, secret).
Publish(image).
Tag(ctx, tag)
}@function
async def example(context: dagger.Directory, platform: List[], file: str, target: str, build_arg: List[str], secret: List[dagger.Secret], image: str, tag: str) -> str:
return await (
dag.docker()
.build(context, platform, file, target, build_arg, secret)
.publish(image)
.tag(tag)
)@func()
async example(context: Directory, platform: [], file: string, target: string, buildArg: string[], secret: Secret[], image: string, tag: string): Promise<string> {
return dag
.docker()
.build(context, platform, file, target, buildArg, secret)
.publish(image)
.tag(tag)
}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 |
Example
dagger -m github.com/opopops/daggerverse/docker@327a52a86fa82c8a28102a10c27acac1525686a0 call \
build --context DIR_PATH --file string --target string --build-arg string1 --build-arg string2 \
publish --image string \
with-scan --output-format stringfunc (m *MyModule) Example(context *dagger.Directory, platform [], file string, target string, buildArg []string, secret []*dagger.Secret, image string, outputFormat string) *dagger.DockerImage {
return dag.
Docker().
Build(context, platform, file, target, buildArg, secret).
Publish(image).
WithScan(outputFormat)
}@function
def example(context: dagger.Directory, platform: List[], file: str, target: str, build_arg: List[str], secret: List[dagger.Secret], image: str, output_format: str) -> dagger.DockerImage:
return (
dag.docker()
.build(context, platform, file, target, build_arg, secret)
.publish(image)
.with_scan(output_format)
)@func()
example(context: Directory, platform: [], file: string, target: string, buildArg: string[], secret: Secret[], image: string, outputFormat: string): DockerImage {
return dag
.docker()
.build(context, platform, file, target, buildArg, secret)
.publish(image)
.withScan(outputFormat)
}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 ! | false | If a multi-arch image is specified, additionally sign each discrete image |
Example
dagger -m github.com/opopops/daggerverse/docker@327a52a86fa82c8a28102a10c27acac1525686a0 call \
build --context DIR_PATH --file string --target string --build-arg string1 --build-arg string2 \
publish --image string \
with-sign --private-key env:MYSECRET --password env:MYSECRET --recursive booleanfunc (m *MyModule) Example(context *dagger.Directory, platform [], file string, target string, buildArg []string, secret []*dagger.Secret, image string, privateKey *dagger.Secret, password *dagger.Secret, recursive bool) *dagger.DockerImage {
return dag.
Docker().
Build(context, platform, file, target, buildArg, secret).
Publish(image).
WithSign(privateKey, password, recursive)
}@function
def example(context: dagger.Directory, platform: List[], file: str, target: str, build_arg: List[str], secret: List[dagger.Secret], image: str, private_key: dagger.Secret, password: dagger.Secret, recursive: bool) -> dagger.DockerImage:
return (
dag.docker()
.build(context, platform, file, target, build_arg, secret)
.publish(image)
.with_sign(private_key, password, recursive)
)@func()
example(context: Directory, platform: [], file: string, target: string, buildArg: string[], secret: Secret[], image: string, privateKey: Secret, password: Secret, recursive: boolean): DockerImage {
return dag
.docker()
.build(context, platform, file, target, buildArg, secret)
.publish(image)
.withSign(privateKey, password, recursive)
}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@327a52a86fa82c8a28102a10c27acac1525686a0 call \
build --context DIR_PATH --file string --target string --build-arg string1 --build-arg string2 \
publish --image string \
with-tag --tag stringfunc (m *MyModule) Example(context *dagger.Directory, platform [], file string, target string, buildArg []string, secret []*dagger.Secret, image string, tag string) *dagger.DockerImage {
return dag.
Docker().
Build(context, platform, file, target, buildArg, secret).
Publish(image).
WithTag(tag)
}@function
def example(context: dagger.Directory, platform: List[], file: str, target: str, build_arg: List[str], secret: List[dagger.Secret], image: str, tag: str) -> dagger.DockerImage:
return (
dag.docker()
.build(context, platform, file, target, build_arg, secret)
.publish(image)
.with_tag(tag)
)@func()
example(context: Directory, platform: [], file: string, target: string, buildArg: string[], secret: Secret[], image: string, tag: string): DockerImage {
return dag
.docker()
.build(context, platform, file, target, buildArg, secret)
.publish(image)
.withTag(tag)
}Build 🔗
Docker Build
registry() 🔗
Return Type
String Example
dagger -m github.com/opopops/daggerverse/docker@327a52a86fa82c8a28102a10c27acac1525686a0 call \
build --context DIR_PATH --file string --target string --build-arg string1 --build-arg string2 \
registryfunc (m *MyModule) Example(ctx context.Context, context *dagger.Directory, platform [], file string, target string, buildArg []string, secret []*dagger.Secret) string {
return dag.
Docker().
Build(context, platform, file, target, buildArg, secret).
Registry(ctx)
}@function
async def example(context: dagger.Directory, platform: List[], file: str, target: str, build_arg: List[str], secret: List[dagger.Secret]) -> str:
return await (
dag.docker()
.build(context, platform, file, target, build_arg, secret)
.registry()
)@func()
async example(context: Directory, platform: [], file: string, target: string, buildArg: string[], secret: Secret[]): Promise<string> {
return dag
.docker()
.build(context, platform, file, target, buildArg, secret)
.registry()
}username() 🔗
Return Type
String Example
dagger -m github.com/opopops/daggerverse/docker@327a52a86fa82c8a28102a10c27acac1525686a0 call \
build --context DIR_PATH --file string --target string --build-arg string1 --build-arg string2 \
usernamefunc (m *MyModule) Example(ctx context.Context, context *dagger.Directory, platform [], file string, target string, buildArg []string, secret []*dagger.Secret) string {
return dag.
Docker().
Build(context, platform, file, target, buildArg, secret).
Username(ctx)
}@function
async def example(context: dagger.Directory, platform: List[], file: str, target: str, build_arg: List[str], secret: List[dagger.Secret]) -> str:
return await (
dag.docker()
.build(context, platform, file, target, build_arg, secret)
.username()
)@func()
async example(context: Directory, platform: [], file: string, target: string, buildArg: string[], secret: Secret[]): Promise<string> {
return dag
.docker()
.build(context, platform, file, target, buildArg, secret)
.username()
}password() 🔗
Return Type
Secret Example
dagger -m github.com/opopops/daggerverse/docker@327a52a86fa82c8a28102a10c27acac1525686a0 call \
build --context DIR_PATH --file string --target string --build-arg string1 --build-arg string2 \
passwordfunc (m *MyModule) Example(context *dagger.Directory, platform [], file string, target string, buildArg []string, secret []*dagger.Secret) *dagger.Secret {
return dag.
Docker().
Build(context, platform, file, target, buildArg, secret).
Password()
}@function
def example(context: dagger.Directory, platform: List[], file: str, target: str, build_arg: List[str], secret: List[dagger.Secret]) -> dagger.Secret:
return (
dag.docker()
.build(context, platform, file, target, build_arg, secret)
.password()
)@func()
example(context: Directory, platform: [], file: string, target: string, buildArg: string[], secret: Secret[]): Secret {
return dag
.docker()
.build(context, platform, file, target, buildArg, secret)
.password()
}asTarball() 🔗
Export container as tarball
Return Type
File !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| compress | Boolean ! | false | Enable compression |
Example
dagger -m github.com/opopops/daggerverse/docker@327a52a86fa82c8a28102a10c27acac1525686a0 call \
build --context DIR_PATH --file string --target string --build-arg string1 --build-arg string2 \
as-tarball --compress booleanfunc (m *MyModule) Example(context *dagger.Directory, platform [], file string, target string, buildArg []string, secret []*dagger.Secret, compress bool) *dagger.File {
return dag.
Docker().
Build(context, platform, file, target, buildArg, secret).
AsTarball(compress)
}@function
def example(context: dagger.Directory, platform: List[], file: str, target: str, build_arg: List[str], secret: List[dagger.Secret], compress: bool) -> dagger.File:
return (
dag.docker()
.build(context, platform, file, target, build_arg, secret)
.as_tarball(compress)
)@func()
example(context: Directory, platform: [], file: string, target: string, buildArg: string[], secret: Secret[], compress: boolean): File {
return dag
.docker()
.build(context, platform, file, target, buildArg, secret)
.asTarball(compress)
}container() 🔗
Returns the current host platform variant container
Return Type
Container ! Example
dagger -m github.com/opopops/daggerverse/docker@327a52a86fa82c8a28102a10c27acac1525686a0 call \
build --context DIR_PATH --file string --target string --build-arg string1 --build-arg string2 \
containerfunc (m *MyModule) Example(context *dagger.Directory, platform [], file string, target string, buildArg []string, secret []*dagger.Secret) *dagger.Container {
return dag.
Docker().
Build(context, platform, file, target, buildArg, secret).
Container()
}@function
def example(context: dagger.Directory, platform: List[], file: str, target: str, build_arg: List[str], secret: List[dagger.Secret]) -> dagger.Container:
return (
dag.docker()
.build(context, platform, file, target, build_arg, secret)
.container()
)@func()
example(context: Directory, platform: [], file: string, target: string, buildArg: string[], secret: Secret[]): Container {
return dag
.docker()
.build(context, platform, file, target, buildArg, secret)
.container()
}platforms() 🔗
Retrieves build platforms
Return Type
[Scalar ! ] ! Example
dagger -m github.com/opopops/daggerverse/docker@327a52a86fa82c8a28102a10c27acac1525686a0 call \
build --context DIR_PATH --file string --target string --build-arg string1 --build-arg string2 \
platformsfunc (m *MyModule) Example(context *dagger.Directory, platform [], file string, target string, buildArg []string, secret []*dagger.Secret) [] {
return dag.
Docker().
Build(context, platform, file, target, buildArg, secret).
Platforms()
}@function
def example(context: dagger.Directory, platform: List[], file: str, target: str, build_arg: List[str], secret: List[dagger.Secret]) -> List[]:
return (
dag.docker()
.build(context, platform, file, target, build_arg, secret)
.platforms()
)@func()
example(context: Directory, platform: [], file: string, target: string, buildArg: string[], secret: Secret[]): [] {
return dag
.docker()
.build(context, platform, file, target, buildArg, secret)
.platforms()
}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@327a52a86fa82c8a28102a10c27acac1525686a0 call \
build --context DIR_PATH --file string --target string --build-arg string1 --build-arg string2 \
publish --image stringfunc (m *MyModule) Example(context *dagger.Directory, platform [], file string, target string, buildArg []string, secret []*dagger.Secret, image string) *dagger.DockerImage {
return dag.
Docker().
Build(context, platform, file, target, buildArg, secret).
Publish(image)
}@function
def example(context: dagger.Directory, platform: List[], file: str, target: str, build_arg: List[str], secret: List[dagger.Secret], image: str) -> dagger.DockerImage:
return (
dag.docker()
.build(context, platform, file, target, build_arg, secret)
.publish(image)
)@func()
example(context: Directory, platform: [], file: string, target: string, buildArg: string[], secret: Secret[], image: string): DockerImage {
return dag
.docker()
.build(context, platform, file, target, buildArg, secret)
.publish(image)
}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 |
Example
dagger -m github.com/opopops/daggerverse/docker@327a52a86fa82c8a28102a10c27acac1525686a0 call \
build --context DIR_PATH --file string --target string --build-arg string1 --build-arg string2 \
scan --output-format stringfunc (m *MyModule) Example(ctx context.Context, context *dagger.Directory, platform [], file string, target string, buildArg []string, secret []*dagger.Secret, outputFormat string) string {
return dag.
Docker().
Build(context, platform, file, target, buildArg, secret).
Scan(ctxoutputFormat)
}@function
async def example(context: dagger.Directory, platform: List[], file: str, target: str, build_arg: List[str], secret: List[dagger.Secret], output_format: str) -> str:
return await (
dag.docker()
.build(context, platform, file, target, build_arg, secret)
.scan(output_format)
)@func()
async example(context: Directory, platform: [], file: string, target: string, buildArg: string[], secret: Secret[], outputFormat: string): Promise<string> {
return dag
.docker()
.build(context, platform, file, target, buildArg, secret)
.scan(outputFormat)
}withRegistryAuth() 🔗
Authenticate with registry
Return Type
Build !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| username | String ! | - | Registry username |
| secret | Secret ! | - | Registry password |
| address | String ! | "docker.io" | Registry host |
Example
dagger -m github.com/opopops/daggerverse/docker@327a52a86fa82c8a28102a10c27acac1525686a0 call \
build --context DIR_PATH --file string --target string --build-arg string1 --build-arg string2 \
with-registry-auth --username string --secret env:MYSECRET --address stringfunc (m *MyModule) Example(context *dagger.Directory, platform [], file string, target string, buildArg []string, secret []*dagger.Secret, username string, secret1 *dagger.Secret, address string) *dagger.DockerBuild {
return dag.
Docker().
Build(context, platform, file, target, buildArg, secret).
WithRegistryAuth(username, secret1, address)
}@function
def example(context: dagger.Directory, platform: List[], file: str, target: str, build_arg: List[str], secret: List[dagger.Secret], username: str, secret1: dagger.Secret, address: str) -> dagger.DockerBuild:
return (
dag.docker()
.build(context, platform, file, target, build_arg, secret)
.with_registry_auth(username, secret1, address)
)@func()
example(context: Directory, platform: [], file: string, target: string, buildArg: string[], secret: Secret[], username: string, secret1: Secret, address: string): DockerBuild {
return dag
.docker()
.build(context, platform, file, target, buildArg, secret)
.withRegistryAuth(username, secret1, address)
}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 |
Example
dagger -m github.com/opopops/daggerverse/docker@327a52a86fa82c8a28102a10c27acac1525686a0 call \
build --context DIR_PATH --file string --target string --build-arg string1 --build-arg string2 \
with-scan --output-format stringfunc (m *MyModule) Example(context *dagger.Directory, platform [], file string, target string, buildArg []string, secret []*dagger.Secret, outputFormat string) *dagger.DockerBuild {
return dag.
Docker().
Build(context, platform, file, target, buildArg, secret).
WithScan(outputFormat)
}@function
def example(context: dagger.Directory, platform: List[], file: str, target: str, build_arg: List[str], secret: List[dagger.Secret], output_format: str) -> dagger.DockerBuild:
return (
dag.docker()
.build(context, platform, file, target, build_arg, secret)
.with_scan(output_format)
)@func()
example(context: Directory, platform: [], file: string, target: string, buildArg: string[], secret: Secret[], outputFormat: string): DockerBuild {
return dag
.docker()
.build(context, platform, file, target, buildArg, secret)
.withScan(outputFormat)
}Docker 🔗
Docker CLI
registry() 🔗
Return Type
String Example
dagger -m github.com/opopops/daggerverse/docker@327a52a86fa82c8a28102a10c27acac1525686a0 call \
registryfunc (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@327a52a86fa82c8a28102a10c27acac1525686a0 call \
usernamefunc (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@327a52a86fa82c8a28102a10c27acac1525686a0 call \
passwordfunc (m *MyModule) Example() *dagger.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 OCI image
Return Type
Build !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| context | Directory ! | - | Dockerfile context |
| platform | [Scalar ! ] ! | [] | Set target platform for build |
| file | String ! | "Dockerfile" | Name of the Dockerfile |
| target | String ! | "" | Set the target build stage to build |
| buildArg | [String ! ] ! | [] | Build args to pass to the build in the format of name=value |
| secret | [Secret ! ] ! | [] | Secrets to pass to the build |
Example
dagger -m github.com/opopops/daggerverse/docker@327a52a86fa82c8a28102a10c27acac1525686a0 call \
build --context DIR_PATH --file string --target string --build-arg string1 --build-arg string2func (m *MyModule) Example(context *dagger.Directory, platform [], file string, target string, buildArg []string, secret []*dagger.Secret) *dagger.DockerBuild {
return dag.
Docker().
Build(context, platform, file, target, buildArg, secret)
}@function
def example(context: dagger.Directory, platform: List[], file: str, target: str, build_arg: List[str], secret: List[dagger.Secret]) -> dagger.DockerBuild:
return (
dag.docker()
.build(context, platform, file, target, build_arg, secret)
)@func()
example(context: Directory, platform: [], file: string, target: string, buildArg: string[], secret: Secret[]): DockerBuild {
return dag
.docker()
.build(context, platform, file, target, buildArg, secret)
}