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/opopops/daggerverse/docker@7da726bc5e3746066c40f6ca09c5efc90a74d24a
Entrypoint
Return Type
Docker !
Arguments
Name | Type | Description |
---|---|---|
digest | String | No description provided |
platformVariants | [Container ! ] | No description provided |
Example
dagger -m github.com/opopops/daggerverse/docker@7da726bc5e3746066c40f6ca09c5efc90a74d24a call \
func (m *myModule) example() *Docker {
return dag.
Docker()
}
@function
def example() -> dag.Docker:
return (
dag.docker()
)
@func()
example(): Docker {
return dag
.docker()
}
Types
Docker 🔗
Docker module
digest() 🔗
Return Type
String
Example
dagger -m github.com/opopops/daggerverse/docker@7da726bc5e3746066c40f6ca09c5efc90a74d24a call \
digest
func (m *myModule) example(ctx context.Context) string {
return dag.
Docker().
Digest(ctx)
}
@function
async def example() -> str:
return await (
dag.docker()
.digest()
)
@func()
async example(): Promise<string> {
return dag
.docker()
.digest()
}
platformVariants() 🔗
Return Type
[Container ! ]
Example
dagger -m github.com/opopops/daggerverse/docker@7da726bc5e3746066c40f6ca09c5efc90a74d24a call \
platform-variants
func (m *myModule) example() []*Container {
return dag.
Docker().
PlatformVariants()
}
@function
def example() -> List[dagger.Container]:
return (
dag.docker()
.platform_variants()
)
@func()
example(): Container[] {
return dag
.docker()
.platformVariants()
}
import() 🔗
Import a Doker image
Return Type
Container !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
address | String ! | - | image address |
Example
dagger -m github.com/opopops/daggerverse/docker@7da726bc5e3746066c40f6ca09c5efc90a74d24a call \
import --address string
func (m *myModule) example(address string) *Container {
return dag.
Docker().
Import(address)
}
@function
def example(address: str) -> dagger.Container:
return (
dag.docker()
.import_(address)
)
@func()
example(address: string): Container {
return dag
.docker()
.import(address)
}
platforms() 🔗
Retrieve multi-arch image platforms
Return Type
[Scalar ! ] !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
address | String ! | - | image address |
dockerImage | String | "chainguard/docker-cli:latest" | No description provided |
Example
dagger -m github.com/opopops/daggerverse/docker@7da726bc5e3746066c40f6ca09c5efc90a74d24a call \
platforms --address string
func (m *myModule) example(address string) [] {
return dag.
Docker().
Platforms(address)
}
@function
def example(address: str) -> List[]:
return (
dag.docker()
.platforms(address)
)
@func()
example(address: string): [] {
return dag
.docker()
.platforms(address)
}
apko() 🔗
Build multi-arch image using Chainguard apko tool
Return Type
Docker !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
tag | String ! | - | image tag |
context | Directory ! | - | context directory |
arch | String | - | No description provided |
config | String | "apko.yaml" | No description provided |
apkoImage | String | "chainguard/apko:latest" | No description provided |
shellImage | String | "chainguard/bash:latest" | No description provided |
user | String ! | "nonroot" | docker image user |
Example
dagger -m github.com/opopops/daggerverse/docker@7da726bc5e3746066c40f6ca09c5efc90a74d24a call \
apko --tag string --context DIR_PATH --user string
func (m *myModule) example(tag string, context *Directory, user string) *Docker {
return dag.
Docker().
Apko(tag, context, user)
}
@function
def example(tag: str, context: dagger.Directory, user: str) -> dag.Docker:
return (
dag.docker()
.apko(tag, context, user)
)
@func()
example(tag: string, context: Directory, user: string): Docker {
return dag
.docker()
.apko(tag, context, user)
}
build() 🔗
Build multi-arch image using Dockerfile
Return Type
Docker !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
context | Directory ! | - | Dockerfile context |
platform | String | - | No description provided |
dockerfile | String | "Dockerfile" | No description provided |
target | String | "" | No description provided |
Example
dagger -m github.com/opopops/daggerverse/docker@7da726bc5e3746066c40f6ca09c5efc90a74d24a call \
build --context DIR_PATH
func (m *myModule) example(context *Directory) *Docker {
return dag.
Docker().
Build(context)
}
@function
def example(context: dagger.Directory) -> dag.Docker:
return (
dag.docker()
.build(context)
)
@func()
example(context: Directory): Docker {
return dag
.docker()
.build(context)
}
export() 🔗
Export image as tarball
Return Type
File !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
address | String | - | No description provided |
compress | Boolean | false | No description provided |
Example
dagger -m github.com/opopops/daggerverse/docker@7da726bc5e3746066c40f6ca09c5efc90a74d24a call \
export
func (m *myModule) example() *File {
return dag.
Docker().
Export()
}
@function
def example() -> dagger.File:
return (
dag.docker()
.export()
)
@func()
example(): File {
return dag
.docker()
.export()
}
publish() 🔗
Publish multi-arch image
Return Type
Docker !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
tag | [String ! ] ! | - | image tag |
address | String | - | No description provided |
username | String | - | No description provided |
password | Secret | - | No description provided |
Example
dagger -m github.com/opopops/daggerverse/docker@7da726bc5e3746066c40f6ca09c5efc90a74d24a call \
publish --tag string1 --tag string2
func (m *myModule) example(tag []string) *Docker {
return dag.
Docker().
Publish(tag)
}
@function
def example(tag: List[str]) -> dag.Docker:
return (
dag.docker()
.publish(tag)
)
@func()
example(tag: string[]): Docker {
return dag
.docker()
.publish(tag)
}
sign() 🔗
Sign multi-arch image with Cosign
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
privateKey | Secret ! | - | cosign private key |
password | Secret ! | - | cosign password |
digest | String | - | No description provided |
registryUsername | String | null | No description provided |
registryPassword | Secret | null | No description provided |
dockerConfig | File | null | No description provided |
cosignImage | String ! | "chainguard/cosign:latest" | cosign image |
cosignUser | String ! | "nonroot" | cosign image user |
Example
dagger -m github.com/opopops/daggerverse/docker@7da726bc5e3746066c40f6ca09c5efc90a74d24a call \
sign --private-key env:MYSECRET --password env:MYSECRET --cosign-image string --cosign-user string
func (m *myModule) example(ctx context.Context, privateKey *Secret, password *Secret, cosignImage string, cosignUser string) string {
return dag.
Docker().
Sign(ctx, privateKey, password, cosignImage, cosignUser)
}
@function
async def example(private_key: dagger.Secret, password: dagger.Secret, cosign_image: str, cosign_user: str) -> str:
return await (
dag.docker()
.sign(private_key, password, cosign_image, cosign_user)
)
@func()
async example(privateKey: Secret, password: Secret, cosignImage: string, cosignUser: string): Promise<string> {
return dag
.docker()
.sign(privateKey, password, cosignImage, cosignUser)
}
scan() 🔗
Scan image with Grype and return the formatted report
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
address | String | - | No description provided |
failOn | String | null | No description provided |
outputFormat | String ! | "table" | Report output formatter |
grypeImage | String ! | "chainguard/grype:latest" | Grype image |
grypeUser | String ! | "nonroot" | Grype image user |
Example
dagger -m github.com/opopops/daggerverse/docker@7da726bc5e3746066c40f6ca09c5efc90a74d24a call \
scan --output-format string --grype-image string --grype-user string
func (m *myModule) example(ctx context.Context, outputFormat string, grypeImage string, grypeUser string) string {
return dag.
Docker().
Scan(ctxoutputFormat, grypeImage, grypeUser)
}
@function
async def example(output_format: str, grype_image: str, grype_user: str) -> str:
return await (
dag.docker()
.scan(output_format, grype_image, grype_user)
)
@func()
async example(outputFormat: string, grypeImage: string, grypeUser: string): Promise<string> {
return dag
.docker()
.scan(outputFormat, grypeImage, grypeUser)
}