Dagger
Search

container-images

Portable container image CI scenario.

Installation

dagger install github.com/riftonix/daggerverse/scenarios/container-images@ae20ec34c46403410388a3491ab601e10dcbcac0

Entrypoint

Return Type
ContainerImages !
Example
dagger -m github.com/riftonix/daggerverse/scenarios/container-images@ae20ec34c46403410388a3491ab601e10dcbcac0 call \
func (m *MyModule) Example() *dagger.ContainerImages  {
	return dag.
			ContainerImages()
}
@function
def example() -> dagger.ContainerImages:
	return (
		dag.container_images()
	)
@func()
example(): ContainerImages {
	return dag
		.containerImages()
}

Types

ContainerImages 🔗

Container image scenario entrypoint.

module() 🔗

Return the scenario name.

Return Type
String !
Example
dagger -m github.com/riftonix/daggerverse/scenarios/container-images@ae20ec34c46403410388a3491ab601e10dcbcac0 call \
 module
func (m *MyModule) Example(ctx context.Context) string  {
	return dag.
			ContainerImages().
			Module(ctx)
}
@function
async def example() -> str:
	return await (
		dag.container_images()
		.module()
	)
@func()
async example(): Promise<string> {
	return dag
		.containerImages()
		.module()
}

verifyImage() 🔗

Build and optionally smoke-check one explicit image context.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
sourceDirectory -

Source directory containing the image build context

contextPathString !-

Build context path relative to source

dockerfilePathString !"Dockerfile"

Dockerfile path relative to context

targetString null

Optional Docker build target

buildArgs[String ! ] null

Optional build arguments in KEY=VALUE form

platforms[Scalar ! ] null

Optional target platforms

smokeCommand[String ! ] null

Optional command to run in the built image

Example
dagger -m github.com/riftonix/daggerverse/scenarios/container-images@ae20ec34c46403410388a3491ab601e10dcbcac0 call \
 verify-image --context-path string --dockerfile-path string
func (m *MyModule) Example(ctx context.Context, contextPath string, dockerfilePath string) string  {
	return dag.
			ContainerImages().
			VerifyImage(ctxcontextPath, dockerfilePath)
}
@function
async def example(context_path: str, dockerfile_path: str) -> str:
	return await (
		dag.container_images()
		.verify_image(context_path, dockerfile_path)
	)
@func()
async example(contextPath: string, dockerfilePath: string): Promise<string> {
	return dag
		.containerImages()
		.verifyImage(contextPath, dockerfilePath)
}

verifyImages() 🔗

Build and optionally smoke-check multiple explicit image contexts.

Return Type
[String ! ] !
Arguments
NameTypeDefault ValueDescription
sourceDirectory -

Source directory containing the image build contexts

contextPaths[String ! ] !-

Build context paths relative to source

dockerfilePathString !"Dockerfile"

Dockerfile path relative to each context

targetString null

Optional Docker build target

buildArgs[String ! ] null

Optional build arguments in KEY=VALUE form

platforms[Scalar ! ] null

Optional target platforms

smokeCommand[String ! ] null

Optional command to run in each built image

Example
dagger -m github.com/riftonix/daggerverse/scenarios/container-images@ae20ec34c46403410388a3491ab601e10dcbcac0 call \
 verify-images --context-paths string1 --context-paths string2 --dockerfile-path string
func (m *MyModule) Example(ctx context.Context, contextPaths []string, dockerfilePath string) []string  {
	return dag.
			ContainerImages().
			VerifyImages(ctxcontextPaths, dockerfilePath)
}
@function
async def example(context_paths: List[str], dockerfile_path: str) -> List[str]:
	return await (
		dag.container_images()
		.verify_images(context_paths, dockerfile_path)
	)
@func()
async example(contextPaths: string[], dockerfilePath: string): Promise<string[]> {
	return dag
		.containerImages()
		.verifyImages(contextPaths, dockerfilePath)
}

publishImage() 🔗

Build and publish one explicit image context.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
sourceDirectory -

Source directory containing the image build context

contextPathString !-

Build context path relative to source

imageRefString !-

Destination OCI image reference

dockerfilePathString !"Dockerfile"

Dockerfile path relative to context

targetString null

Optional Docker build target

buildArgs[String ! ] null

Optional build arguments in KEY=VALUE form

platforms[Scalar ! ] null

Optional target platforms

registryAddressString null

Optional registry address for authentication

registryUsernameString null

Optional registry username

registryPasswordSecret null

Optional registry password or token secret

publishDryRunBoolean !false

Validate publish inputs without pushing to a registry

Example
dagger -m github.com/riftonix/daggerverse/scenarios/container-images@ae20ec34c46403410388a3491ab601e10dcbcac0 call \
 publish-image --context-path string --image-ref string --dockerfile-path string --publish-dry-run boolean
func (m *MyModule) Example(ctx context.Context, contextPath string, imageRef string, dockerfilePath string, publishDryRun bool) string  {
	return dag.
			ContainerImages().
			PublishImage(ctxcontextPath, imageRef, dockerfilePath, publishDryRun)
}
@function
async def example(context_path: str, image_ref: str, dockerfile_path: str, publish_dry_run: bool) -> str:
	return await (
		dag.container_images()
		.publish_image(context_path, image_ref, dockerfile_path, publish_dry_run)
	)
@func()
async example(contextPath: string, imageRef: string, dockerfilePath: string, publishDryRun: boolean): Promise<string> {
	return dag
		.containerImages()
		.publishImage(contextPath, imageRef, dockerfilePath, publishDryRun)
}

publishImages() 🔗

Build and publish multiple explicit image contexts.

Return Type
[String ! ] !
Arguments
NameTypeDefault ValueDescription
sourceDirectory -

Source directory containing the image build contexts

publishSpecs[String ! ] !-

Image publish specs in CONTEXT_PATH=IMAGE_REF form

dockerfilePathString !"Dockerfile"

Dockerfile path relative to each context

targetString null

Optional Docker build target

buildArgs[String ! ] null

Optional build arguments in KEY=VALUE form

platforms[Scalar ! ] null

Optional target platforms

registryAddressString null

Optional registry address for authentication

registryUsernameString null

Optional registry username

registryPasswordSecret null

Optional registry password or token secret

publishDryRunBoolean !false

Validate publish inputs without pushing to a registry

Example
dagger -m github.com/riftonix/daggerverse/scenarios/container-images@ae20ec34c46403410388a3491ab601e10dcbcac0 call \
 publish-images --publish-specs string1 --publish-specs string2 --dockerfile-path string --publish-dry-run boolean
func (m *MyModule) Example(ctx context.Context, publishSpecs []string, dockerfilePath string, publishDryRun bool) []string  {
	return dag.
			ContainerImages().
			PublishImages(ctxpublishSpecs, dockerfilePath, publishDryRun)
}
@function
async def example(publish_specs: List[str], dockerfile_path: str, publish_dry_run: bool) -> List[str]:
	return await (
		dag.container_images()
		.publish_images(publish_specs, dockerfile_path, publish_dry_run)
	)
@func()
async example(publishSpecs: string[], dockerfilePath: string, publishDryRun: boolean): Promise<string[]> {
	return dag
		.containerImages()
		.publishImages(publishSpecs, dockerfilePath, publishDryRun)
}