docker
Build, publish, scan and sign Docker images.
Installation
dagger install github.com/opopops/docker@v0.0.2Entrypoint
Return Type
Docker !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| container | [Container ! ] | - | Image address. |
| digest | String ! | "" | Image digest. |
Example
dagger -m github.com/opopops/docker@230c9f3121bd02566d86766fd333d65c97166454 call \
--digest stringfunc (m *MyModule) Example(digest string) *dagger.Docker {
return dag.
Docker(digest)
}@function
def example(digest: str) -> dagger.Docker:
return (
dag.docker(digest)
)@func()
example(digest: string): Docker {
return dag
.docker(digest)
}Types
Docker 🔗
Docker module
container() 🔗
Image address.
Return Type
[Container ! ] ! Example
dagger -m github.com/opopops/docker@230c9f3121bd02566d86766fd333d65c97166454 call \
--digest string containerfunc (m *MyModule) Example(digest string) []*dagger.Container {
return dag.
Docker(digest).
Container()
}@function
def example(digest: str) -> List[dagger.Container]:
return (
dag.docker(digest)
.container()
)@func()
example(digest: string): Container[] {
return dag
.docker(digest)
.container()
}digest() 🔗
Image digest.
Return Type
String ! Example
dagger -m github.com/opopops/docker@230c9f3121bd02566d86766fd333d65c97166454 call \
--digest string digestfunc (m *MyModule) Example(ctx context.Context, digest string) string {
return dag.
Docker(digest).
Digest(ctx)
}@function
async def example(digest: str) -> str:
return await (
dag.docker(digest)
.digest()
)@func()
async example(digest: string): Promise<string> {
return dag
.docker(digest)
.digest()
}import() 🔗
Import a Doker image
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| address | String ! | - | Image's address from its registry. |
Example
dagger -m github.com/opopops/docker@230c9f3121bd02566d86766fd333d65c97166454 call \
--digest string import --address stringfunc (m *MyModule) Example(digest string, address string) *dagger.Container {
return dag.
Docker(digest).
Import(address)
}@function
def example(digest: str, address: str) -> dagger.Container:
return (
dag.docker(digest)
.import_(address)
)@func()
example(digest: string, address: string): Container {
return dag
.docker(digest)
.import(address)
}apko() 🔗
Build multi-platform image using Chainguard apko tool (apk-based OCI image builder).
Return Type
Docker !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| context | Directory ! | - | Directory context used by apko. |
| config | String ! | "apko.yaml" | apko config file. |
| arch | String | null | No description provided |
| image | String ! | "chainguard/apko:latest" | apko Docker image. |
Example
dagger -m github.com/opopops/docker@230c9f3121bd02566d86766fd333d65c97166454 call \
--digest string apko --context DIR_PATH --config string --image stringfunc (m *MyModule) Example(digest string, context *dagger.Directory, config string, image string) *dagger.Docker {
return dag.
Docker(digest).
Apko(context, config, image)
}@function
def example(digest: str, context: dagger.Directory, config: str, image: str) -> dagger.Docker:
return (
dag.docker(digest)
.apko(context, config, image)
)@func()
example(digest: string, context: Directory, config: string, image: string): Docker {
return dag
.docker(digest)
.apko(context, config, image)
}build() 🔗
Build multi-platform image using Dockerfile.
Return Type
Docker !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| context | Directory ! | - | Directory context used by the Dockerfile. |
| dockerfile | String ! | "Dockerfile" | Path to the Dockerfile to use. |
| platform | String | null | No description provided |
| target | String ! | "" | Target build stage to build. |
Example
dagger -m github.com/opopops/docker@230c9f3121bd02566d86766fd333d65c97166454 call \
--digest string build --context DIR_PATH --dockerfile string --target stringfunc (m *MyModule) Example(digest string, context *dagger.Directory, dockerfile string, target string) *dagger.Docker {
return dag.
Docker(digest).
Build(context, dockerfile, target)
}@function
def example(digest: str, context: dagger.Directory, dockerfile: str, target: str) -> dagger.Docker:
return (
dag.docker(digest)
.build(context, dockerfile, target)
)@func()
example(digest: string, context: Directory, dockerfile: string, target: string): Docker {
return dag
.docker(digest)
.build(context, dockerfile, target)
}scan() 🔗
Scan image with Grype and return the formatted report
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| container | Container | null | No description provided |
| failOn | String | null | No description provided |
| outputFormat | String ! | "table" | Report output formatter. |
| image | String ! | "chainguard/grype:latest" | Grype Docker image. |
Example
dagger -m github.com/opopops/docker@230c9f3121bd02566d86766fd333d65c97166454 call \
--digest string scan --output-format string --image stringfunc (m *MyModule) Example(ctx context.Context, digest string, outputFormat string, image string) string {
return dag.
Docker(digest).
Scan(ctxoutputFormat, image)
}@function
async def example(digest: str, output_format: str, image: str) -> str:
return await (
dag.docker(digest)
.scan(output_format, image)
)@func()
async example(digest: string, outputFormat: string, image: string): Promise<string> {
return dag
.docker(digest)
.scan(outputFormat, image)
}export() 🔗
Export image as tarball.
Return Type
File !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| platformVariants | [Container ! ] | null | No description provided |
| compress | Boolean | false | No description provided |
Example
dagger -m github.com/opopops/docker@230c9f3121bd02566d86766fd333d65c97166454 call \
--digest string exportfunc (m *MyModule) Example(digest string) *dagger.File {
return dag.
Docker(digest).
Export()
}@function
def example(digest: str) -> dagger.File:
return (
dag.docker(digest)
.export()
)@func()
example(digest: string): File {
return dag
.docker(digest)
.export()
}publish() 🔗
Publish multi-platform image.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| address | [String ! ] ! | - | No description provided |
| platformVariants | [Container ! ] | null | No description provided |
| username | String | null | No description provided |
| password | Secret | null | No description provided |
Example
dagger -m github.com/opopops/docker@230c9f3121bd02566d86766fd333d65c97166454 call \
--digest string publish --address string1 --address string2func (m *MyModule) Example(ctx context.Context, digest string, address []string) string {
return dag.
Docker(digest).
Publish(ctx, address)
}@function
async def example(digest: str, address: List[str]) -> str:
return await (
dag.docker(digest)
.publish(address)
)@func()
async example(digest: string, address: string[]): Promise<string> {
return dag
.docker(digest)
.publish(address)
}sign() 🔗
Sign multi-platform image with Cosign.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| privateKey | Secret ! | - | Cosign private key. |
| password | Secret ! | - | Cosign password. |
| digest | String | null | No description provided |
| registryUsername | String | null | No description provided |
| registryPassword | Secret | null | No description provided |
| dockerConfig | File | null | No description provided |
| image | String ! | "chainguard/cosign:latest" | Cosign Docker image. |
Example
dagger -m github.com/opopops/docker@230c9f3121bd02566d86766fd333d65c97166454 call \
--digest string sign --private-key env:MYSECRET --password env:MYSECRET --image stringfunc (m *MyModule) Example(ctx context.Context, digest string, privateKey *dagger.Secret, password *dagger.Secret, image string) string {
return dag.
Docker(digest).
Sign(ctx, privateKey, password, image)
}@function
async def example(digest: str, private_key: dagger.Secret, password: dagger.Secret, image: str) -> str:
return await (
dag.docker(digest)
.sign(private_key, password, image)
)@func()
async example(digest: string, privateKey: Secret, password: Secret, image: string): Promise<string> {
return dag
.docker(digest)
.sign(privateKey, password, image)
}