Dagger
Search

docker

This module has been generated via dagger init and serves as a reference to
basic 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@208b9b68620ba5b94b7ff11306899742b6f06849

Entrypoint

Return Type
Docker !
Arguments
NameTypeDescription
container[Container ! ] image address
digestString !image digest
Example
dagger -m github.com/opopops/daggerverse/docker@208b9b68620ba5b94b7ff11306899742b6f06849 call \
 --digest string
func (m *myModule) example(digest string) *Docker  {
	return dag.
			Docker(digest)
}
@function
def example(digest: str) -> dag.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/daggerverse/docker@208b9b68620ba5b94b7ff11306899742b6f06849 call \
 --digest string container
func (m *myModule) example(digest string) []*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/daggerverse/docker@208b9b68620ba5b94b7ff11306899742b6f06849 call \
 --digest string digest
func (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
NameTypeDefault ValueDescription
addressString !-image address
Example
dagger -m github.com/opopops/daggerverse/docker@208b9b68620ba5b94b7ff11306899742b6f06849 call \
 --digest string import --address string
func (m *myModule) example(digest string, address string) *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
NameTypeDefault ValueDescription
tagString !-image tag
contextDirectory !-context directory
configString !"apko.yaml"config file
archString nullNo description provided
imageString !"chainguard/apko:latest"apko docker image
Example
dagger -m github.com/opopops/daggerverse/docker@208b9b68620ba5b94b7ff11306899742b6f06849 call \
 --digest string apko --tag string --context DIR_PATH --config string --image string
func (m *myModule) example(digest string, tag string, context *Directory, config string, image string) *Docker  {
	return dag.
			Docker(digest).
			Apko(tag, context, config, image)
}
@function
def example(digest: str, tag: str, context: dagger.Directory, config: str, image: str) -> dag.Docker:
	return (
		dag.docker(digest)
		.apko(tag, context, config, image)
	)
@func()
example(digest: string, tag: string, context: Directory, config: string, image: string): Docker {
	return dag
		.docker(digest)
		.apko(tag, context, config, image)
}

build() 🔗

Build multi-platform image using Dockerfile

Return Type
Docker !
Arguments
NameTypeDefault ValueDescription
contextDirectory !-directory context used by the Dockerfile
dockerfileString !"Dockerfile"path to the Dockerfile to use
platformString nullNo description provided
targetString !""target build stage to build
Example
dagger -m github.com/opopops/daggerverse/docker@208b9b68620ba5b94b7ff11306899742b6f06849 call \
 --digest string build --context DIR_PATH --dockerfile string --target string
func (m *myModule) example(digest string, context *Directory, dockerfile string, target string) *Docker  {
	return dag.
			Docker(digest).
			Build(context, dockerfile, target)
}
@function
def example(digest: str, context: dagger.Directory, dockerfile: str, target: str) -> dag.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
NameTypeDefault ValueDescription
containerContainer nullNo description provided
failOnString nullNo description provided
outputFormatString !"table"Report output formatter
imageString !"chainguard/grype:latest"Grype Docker image
Example
dagger -m github.com/opopops/daggerverse/docker@208b9b68620ba5b94b7ff11306899742b6f06849 call \
 --digest string scan --output-format string --image string
func (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
NameTypeDefault ValueDescription
platformVariants[Container ! ] nullNo description provided
compressBoolean falseNo description provided
Example
dagger -m github.com/opopops/daggerverse/docker@208b9b68620ba5b94b7ff11306899742b6f06849 call \
 --digest string export
func (m *myModule) example(digest string) *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
NameTypeDefault ValueDescription
tag[String ! ] !-No description provided
platformVariants[Container ! ] nullNo description provided
usernameString nullNo description provided
passwordSecret nullNo description provided
Example
dagger -m github.com/opopops/daggerverse/docker@208b9b68620ba5b94b7ff11306899742b6f06849 call \
 --digest string publish --tag string1 --tag string2
func (m *myModule) example(ctx context.Context, digest string, tag []string) string  {
	return dag.
			Docker(digest).
			Publish(ctx, tag)
}
@function
async def example(digest: str, tag: List[str]) -> str:
	return await (
		dag.docker(digest)
		.publish(tag)
	)
@func()
async example(digest: string, tag: string[]): Promise<string> {
	return dag
		.docker(digest)
		.publish(tag)
}

sign() 🔗

Sign multi-platform image with Cosign

Return Type
String !
Arguments
NameTypeDefault ValueDescription
privateKeySecret !-cosign private key
passwordSecret !-cosign password
digestString nullNo description provided
registryUsernameString nullNo description provided
registryPasswordSecret nullNo description provided
dockerConfigFile nullNo description provided
imageString !"chainguard/cosign:latest"cosign docker image
Example
dagger -m github.com/opopops/daggerverse/docker@208b9b68620ba5b94b7ff11306899742b6f06849 call \
 --digest string sign --private-key env:MYSECRET --password env:MYSECRET --image string
func (m *myModule) example(ctx context.Context, digest string, privateKey *Secret, password *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)
}