Dagger
Search

docker

A Dagger Module for integrating with the Docker Engine

Installation

dagger install github.com/shykes/daggerverse/docker@v0.3.0

Entrypoint

Return Type
Docker
Example
dagger -m github.com/shykes/daggerverse/docker@5c47fda7b11300c4a18a4f5e874441006b66c300 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 🔗

A Dagger module to integrate with Docker

engine() 🔗

Spawn an ephemeral Docker Engine in a container

Return Type
Service !
Arguments
NameTypeDefault ValueDescription
versionString "\"24.0\""No description provided
Example
dagger -m github.com/shykes/daggerverse/docker@5c47fda7b11300c4a18a4f5e874441006b66c300 call \
 engine
func (m *myModule) example() *Service  {
	return dag.
			Docker().
			Engine()
}
@function
def example() -> dagger.Service:
	return (
		dag.docker()
		.engine()
	)
@func()
example(): Service {
	return dag
		.docker()
		.engine()
}

cli() 🔗

A Docker CLI ready to query this engine. Entrypoint is set to docker

Return Type
Cli !
Arguments
NameTypeDefault ValueDescription
versionString "\"24.0\""No description provided
engineService -No description provided
Example
dagger -m github.com/shykes/daggerverse/docker@5c47fda7b11300c4a18a4f5e874441006b66c300 call \
 cli
func (m *myModule) example() *DockerCli  {
	return dag.
			Docker().
			Cli()
}
@function
def example() -> dag.DockerCli:
	return (
		dag.docker()
		.cli()
	)
@func()
example(): DockerCli {
	return dag
		.docker()
		.cli()
}

Cli 🔗

A Docker client

engine() 🔗

Return Type
Service !
Example
dagger -m github.com/shykes/daggerverse/docker@5c47fda7b11300c4a18a4f5e874441006b66c300 call \
 cli \
 engine
func (m *myModule) example() *Service  {
	return dag.
			Docker().
			Cli().
			Engine()
}
@function
def example() -> dagger.Service:
	return (
		dag.docker()
		.cli()
		.engine()
	)
@func()
example(): Service {
	return dag
		.docker()
		.cli()
		.engine()
}

container() 🔗

Package the Docker CLI into a container, wired to an engine

Return Type
Container !
Example
dagger -m github.com/shykes/daggerverse/docker@5c47fda7b11300c4a18a4f5e874441006b66c300 call \
 cli \
 container
func (m *myModule) example() *Container  {
	return dag.
			Docker().
			Cli().
			Container()
}
@function
def example() -> dagger.Container:
	return (
		dag.docker()
		.cli()
		.container()
	)
@func()
example(): Container {
	return dag
		.docker()
		.cli()
		.container()
}

pull() 🔗

Execute ‘docker pull’

Return Type
Image !
Arguments
NameTypeDefault ValueDescription
repositoryString !-No description provided
tagString "\"latest\""No description provided
Example
dagger -m github.com/shykes/daggerverse/docker@5c47fda7b11300c4a18a4f5e874441006b66c300 call \
 cli \
 pull --repository string
func (m *myModule) example(repository string) *DockerImage  {
	return dag.
			Docker().
			Cli().
			Pull(repository)
}
@function
def example(repository: str) -> dag.DockerImage:
	return (
		dag.docker()
		.cli()
		.pull(repository)
	)
@func()
example(repository: string): DockerImage {
	return dag
		.docker()
		.cli()
		.pull(repository)
}

push() 🔗

Execute ‘docker push’

Return Type
String !
Arguments
NameTypeDefault ValueDescription
repositoryString !-No description provided
tagString "\"latest\""No description provided
Example
dagger -m github.com/shykes/daggerverse/docker@5c47fda7b11300c4a18a4f5e874441006b66c300 call \
 cli \
 push --repository string
func (m *myModule) example(ctx context.Context, repository string) string  {
	return dag.
			Docker().
			Cli().
			Push(ctx, repository)
}
@function
async def example(repository: str) -> str:
	return await (
		dag.docker()
		.cli()
		.push(repository)
	)
@func()
async example(repository: string): Promise<string> {
	return dag
		.docker()
		.cli()
		.push(repository)
}

withPull() 🔗

Execute ‘docker pull’ and return the CLI state, for chaining.

Return Type
Cli !
Arguments
NameTypeDefault ValueDescription
repositoryString !-No description provided
tagString "\"latest\""No description provided
Example
dagger -m github.com/shykes/daggerverse/docker@5c47fda7b11300c4a18a4f5e874441006b66c300 call \
 cli \
 with-pull --repository string
func (m *myModule) example(repository string) *DockerCli  {
	return dag.
			Docker().
			Cli().
			WithPull(repository)
}
@function
def example(repository: str) -> dag.DockerCli:
	return (
		dag.docker()
		.cli()
		.with_pull(repository)
	)
@func()
example(repository: string): DockerCli {
	return dag
		.docker()
		.cli()
		.withPull(repository)
}

withPush() 🔗

Execute ‘docker push’ and return the CLI state, for chaining.

Return Type
Cli !
Arguments
NameTypeDefault ValueDescription
repositoryString !-No description provided
tagString "\"latest\""No description provided
Example
dagger -m github.com/shykes/daggerverse/docker@5c47fda7b11300c4a18a4f5e874441006b66c300 call \
 cli \
 with-push --repository string
func (m *myModule) example(repository string) *DockerCli  {
	return dag.
			Docker().
			Cli().
			WithPush(repository)
}
@function
def example(repository: str) -> dag.DockerCli:
	return (
		dag.docker()
		.cli()
		.with_push(repository)
	)
@func()
example(repository: string): DockerCli {
	return dag
		.docker()
		.cli()
		.withPush(repository)
}

import() 🔗

Import a container into the Docker Engine

Return Type
Image !
Arguments
NameTypeDefault ValueDescription
containerContainer !-No description provided
Example
dagger -m github.com/shykes/daggerverse/docker@5c47fda7b11300c4a18a4f5e874441006b66c300 call \
 cli \
 import --container IMAGE:TAG
func (m *myModule) example(container *Container) *DockerImage  {
	return dag.
			Docker().
			Cli().
			Import(container)
}
@function
def example(container: dagger.Container) -> dag.DockerImage:
	return (
		dag.docker()
		.cli()
		.import_(container)
	)
@func()
example(container: Container): DockerImage {
	return dag
		.docker()
		.cli()
		.import(container)
}

image() 🔗

Look up an image in the local Docker Engine cache

Return Type
Image !
Arguments
NameTypeDefault ValueDescription
repositoryString !-No description provided
tagString "\"latest\""No description provided
Example
dagger -m github.com/shykes/daggerverse/docker@5c47fda7b11300c4a18a4f5e874441006b66c300 call \
 cli \
 image --repository string
func (m *myModule) example(repository string) *DockerImage  {
	return dag.
			Docker().
			Cli().
			Image(repository)
}
@function
def example(repository: str) -> dag.DockerImage:
	return (
		dag.docker()
		.cli()
		.image(repository)
	)
@func()
example(repository: string): DockerImage {
	return dag
		.docker()
		.cli()
		.image(repository)
}

run() 🔗

Run a container with the docker CLI

Return Type
String !
Arguments
NameTypeDefault ValueDescription
nameString !-No description provided
tagString "\"latest\""No description provided
args[String ! ] -No description provided
Example
dagger -m github.com/shykes/daggerverse/docker@5c47fda7b11300c4a18a4f5e874441006b66c300 call \
 cli \
 run --name string
func (m *myModule) example(ctx context.Context, name string) string  {
	return dag.
			Docker().
			Cli().
			Run(ctx, name)
}
@function
async def example(name: str) -> str:
	return await (
		dag.docker()
		.cli()
		.run(name)
	)
@func()
async example(name: string): Promise<string> {
	return dag
		.docker()
		.cli()
		.run(name)
}

images() 🔗

List images on the local Docker Engine cache

Return Type
[Image ! ] !
Arguments
NameTypeDefault ValueDescription
repositoryString -No description provided
tagString -No description provided
Example
dagger -m github.com/shykes/daggerverse/docker@5c47fda7b11300c4a18a4f5e874441006b66c300 call \
 cli \
 images
func (m *myModule) example() []*DockerImage  {
	return dag.
			Docker().
			Cli().
			Images()
}
@function
def example() -> List[dag.DockerImage]:
	return (
		dag.docker()
		.cli()
		.images()
	)
@func()
example(): DockerImage[] {
	return dag
		.docker()
		.cli()
		.images()
}

Image 🔗

An image store in the local Docker Engine cache

client() 🔗

Return Type
Cli !
Example
dagger -m github.com/shykes/daggerverse/docker@5c47fda7b11300c4a18a4f5e874441006b66c300 call \
 cli \
 image --repository string \
 client
func (m *myModule) example(repository string) *DockerCli  {
	return dag.
			Docker().
			Cli().
			Image(repository).
			Client()
}
@function
def example(repository: str) -> dag.DockerCli:
	return (
		dag.docker()
		.cli()
		.image(repository)
		.client()
	)
@func()
example(repository: string): DockerCli {
	return dag
		.docker()
		.cli()
		.image(repository)
		.client()
}

localId() 🔗

The local identifer of the docker image. Can’t call it ID…

Return Type
String !
Example
dagger -m github.com/shykes/daggerverse/docker@5c47fda7b11300c4a18a4f5e874441006b66c300 call \
 cli \
 image --repository string \
 local-id
func (m *myModule) example(ctx context.Context, repository string) string  {
	return dag.
			Docker().
			Cli().
			Image(repository).
			LocalId(ctx)
}
@function
async def example(repository: str) -> str:
	return await (
		dag.docker()
		.cli()
		.image(repository)
		.local_id()
	)
@func()
async example(repository: string): Promise<string> {
	return dag
		.docker()
		.cli()
		.image(repository)
		.localId()
}

tag() 🔗

Return Type
String !
Example
dagger -m github.com/shykes/daggerverse/docker@5c47fda7b11300c4a18a4f5e874441006b66c300 call \
 cli \
 image --repository string \
 tag
func (m *myModule) example(ctx context.Context, repository string) string  {
	return dag.
			Docker().
			Cli().
			Image(repository).
			Tag(ctx)
}
@function
async def example(repository: str) -> str:
	return await (
		dag.docker()
		.cli()
		.image(repository)
		.tag()
	)
@func()
async example(repository: string): Promise<string> {
	return dag
		.docker()
		.cli()
		.image(repository)
		.tag()
}

repository() 🔗

Return Type
String !
Example
dagger -m github.com/shykes/daggerverse/docker@5c47fda7b11300c4a18a4f5e874441006b66c300 call \
 cli \
 image --repository string \
 repository
func (m *myModule) example(ctx context.Context, repository string) string  {
	return dag.
			Docker().
			Cli().
			Image(repository).
			Repository(ctx)
}
@function
async def example(repository: str) -> str:
	return await (
		dag.docker()
		.cli()
		.image(repository)
		.repository()
	)
@func()
async example(repository: string): Promise<string> {
	return dag
		.docker()
		.cli()
		.image(repository)
		.repository()
}

export() 🔗

Export this image from the docker engine into Dagger

Return Type
Container !
Example
dagger -m github.com/shykes/daggerverse/docker@5c47fda7b11300c4a18a4f5e874441006b66c300 call \
 cli \
 image --repository string \
 export
func (m *myModule) example(repository string) *Container  {
	return dag.
			Docker().
			Cli().
			Image(repository).
			Export()
}
@function
def example(repository: str) -> dagger.Container:
	return (
		dag.docker()
		.cli()
		.image(repository)
		.export()
	)
@func()
example(repository: string): Container {
	return dag
		.docker()
		.cli()
		.image(repository)
		.export()
}

push() 🔗

Push this image to a registry

Return Type
String !
Example
dagger -m github.com/shykes/daggerverse/docker@5c47fda7b11300c4a18a4f5e874441006b66c300 call \
 cli \
 image --repository string \
 push
func (m *myModule) example(ctx context.Context, repository string) string  {
	return dag.
			Docker().
			Cli().
			Image(repository).
			Push(ctx)
}
@function
async def example(repository: str) -> str:
	return await (
		dag.docker()
		.cli()
		.image(repository)
		.push()
	)
@func()
async example(repository: string): Promise<string> {
	return dag
		.docker()
		.cli()
		.image(repository)
		.push()
}

ref() 🔗

Return the image’s ref (remote address)

Return Type
String !
Example
dagger -m github.com/shykes/daggerverse/docker@5c47fda7b11300c4a18a4f5e874441006b66c300 call \
 cli \
 image --repository string \
 ref
func (m *myModule) example(ctx context.Context, repository string) string  {
	return dag.
			Docker().
			Cli().
			Image(repository).
			Ref(ctx)
}
@function
async def example(repository: str) -> str:
	return await (
		dag.docker()
		.cli()
		.image(repository)
		.ref()
	)
@func()
async example(repository: string): Promise<string> {
	return dag
		.docker()
		.cli()
		.image(repository)
		.ref()
}