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@7da726bc5e3746066c40f6ca09c5efc90a74d24a

Entrypoint

Return Type
Docker !
Arguments
NameTypeDescription
digestString 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
NameTypeDefault ValueDescription
addressString !-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
NameTypeDefault ValueDescription
addressString !-image address
dockerImageString "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
NameTypeDefault ValueDescription
tagString !-image tag
contextDirectory !-context directory
archString -No description provided
configString "apko.yaml"No description provided
apkoImageString "chainguard/apko:latest"No description provided
shellImageString "chainguard/bash:latest"No description provided
userString !"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
NameTypeDefault ValueDescription
contextDirectory !-Dockerfile context
platformString -No description provided
dockerfileString "Dockerfile"No description provided
targetString ""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
NameTypeDefault ValueDescription
addressString -No description provided
compressBoolean falseNo 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
NameTypeDefault ValueDescription
tag[String ! ] !-image tag
addressString -No description provided
usernameString -No description provided
passwordSecret -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
NameTypeDefault ValueDescription
privateKeySecret !-cosign private key
passwordSecret !-cosign password
digestString -No description provided
registryUsernameString nullNo description provided
registryPasswordSecret nullNo description provided
dockerConfigFile nullNo description provided
cosignImageString !"chainguard/cosign:latest"cosign image
cosignUserString !"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
NameTypeDefault ValueDescription
addressString -No description provided
failOnString nullNo description provided
outputFormatString !"table"Report output formatter
grypeImageString !"chainguard/grype:latest"Grype image
grypeUserString !"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)
}