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@fefb66deaa228f884be6ea03d2ffa7f8f4fbc868 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
Name | Type | Default Value | Description |
---|---|---|---|
version | String | "24.0" | No description provided |
Example
dagger -m github.com/shykes/daggerverse/docker@fefb66deaa228f884be6ea03d2ffa7f8f4fbc868 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
Name | Type | Default Value | Description |
---|---|---|---|
version | String | "24.0" | No description provided |
engine | Service | - | No description provided |
Example
dagger -m github.com/shykes/daggerverse/docker@fefb66deaa228f884be6ea03d2ffa7f8f4fbc868 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@fefb66deaa228f884be6ea03d2ffa7f8f4fbc868 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@fefb66deaa228f884be6ea03d2ffa7f8f4fbc868 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
Name | Type | Default Value | Description |
---|---|---|---|
repository | String ! | - | No description provided |
tag | String | "latest" | No description provided |
Example
dagger -m github.com/shykes/daggerverse/docker@fefb66deaa228f884be6ea03d2ffa7f8f4fbc868 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
Name | Type | Default Value | Description |
---|---|---|---|
repository | String ! | - | No description provided |
tag | String | "latest" | No description provided |
Example
dagger -m github.com/shykes/daggerverse/docker@fefb66deaa228f884be6ea03d2ffa7f8f4fbc868 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
Name | Type | Default Value | Description |
---|---|---|---|
repository | String ! | - | No description provided |
tag | String | "latest" | No description provided |
Example
dagger -m github.com/shykes/daggerverse/docker@fefb66deaa228f884be6ea03d2ffa7f8f4fbc868 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
Name | Type | Default Value | Description |
---|---|---|---|
repository | String ! | - | No description provided |
tag | String | "latest" | No description provided |
Example
dagger -m github.com/shykes/daggerverse/docker@fefb66deaa228f884be6ea03d2ffa7f8f4fbc868 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
Name | Type | Default Value | Description |
---|---|---|---|
container | Container ! | - | No description provided |
Example
dagger -m github.com/shykes/daggerverse/docker@fefb66deaa228f884be6ea03d2ffa7f8f4fbc868 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 If exactly one image matches the filters, return it. Otherwise, return an error.
Return Type
Image !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
repository | String | - | No description provided |
tag | String | - | No description provided |
localId | String | - | No description provided |
Example
dagger -m github.com/shykes/daggerverse/docker@fefb66deaa228f884be6ea03d2ffa7f8f4fbc868 call \
cli \
image
func (m *myModule) example() *DockerImage {
return dag.
Docker().
Cli().
Image()
}
@function
def example() -> dag.DockerImage:
return (
dag.docker()
.cli()
.image()
)
@func()
example(): DockerImage {
return dag
.docker()
.cli()
.image()
}
run() 🔗
Run a container with the docker CLI
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
name | String ! | - | No description provided |
tag | String | "latest" | No description provided |
args | [String ! ] | - | No description provided |
Example
dagger -m github.com/shykes/daggerverse/docker@fefb66deaa228f884be6ea03d2ffa7f8f4fbc868 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
Name | Type | Default Value | Description |
---|---|---|---|
repository | String | - | No description provided |
tag | String | - | No description provided |
localId | String | - | No description provided |
Example
dagger -m github.com/shykes/daggerverse/docker@fefb66deaa228f884be6ea03d2ffa7f8f4fbc868 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@fefb66deaa228f884be6ea03d2ffa7f8f4fbc868 call \
cli \
image \
client
func (m *myModule) example() *DockerCli {
return dag.
Docker().
Cli().
Image().
Client()
}
@function
def example() -> dag.DockerCli:
return (
dag.docker()
.cli()
.image()
.client()
)
@func()
example(): DockerCli {
return dag
.docker()
.cli()
.image()
.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@fefb66deaa228f884be6ea03d2ffa7f8f4fbc868 call \
cli \
image \
local-id
func (m *myModule) example(ctx context.Context) string {
return dag.
Docker().
Cli().
Image().
LocalId(ctx)
}
@function
async def example() -> str:
return await (
dag.docker()
.cli()
.image()
.local_id()
)
@func()
async example(): Promise<string> {
return dag
.docker()
.cli()
.image()
.localId()
}
tag() 🔗
Return Type
String !
Example
dagger -m github.com/shykes/daggerverse/docker@fefb66deaa228f884be6ea03d2ffa7f8f4fbc868 call \
cli \
image \
tag
func (m *myModule) example(ctx context.Context) string {
return dag.
Docker().
Cli().
Image().
Tag(ctx)
}
@function
async def example() -> str:
return await (
dag.docker()
.cli()
.image()
.tag()
)
@func()
async example(): Promise<string> {
return dag
.docker()
.cli()
.image()
.tag()
}
repository() 🔗
Return Type
String !
Example
dagger -m github.com/shykes/daggerverse/docker@fefb66deaa228f884be6ea03d2ffa7f8f4fbc868 call \
cli \
image \
repository
func (m *myModule) example(ctx context.Context) string {
return dag.
Docker().
Cli().
Image().
Repository(ctx)
}
@function
async def example() -> str:
return await (
dag.docker()
.cli()
.image()
.repository()
)
@func()
async example(): Promise<string> {
return dag
.docker()
.cli()
.image()
.repository()
}
export() 🔗
Export this image from the docker engine into Dagger
Return Type
Container !
Example
dagger -m github.com/shykes/daggerverse/docker@fefb66deaa228f884be6ea03d2ffa7f8f4fbc868 call \
cli \
image \
export
func (m *myModule) example() *Container {
return dag.
Docker().
Cli().
Image().
Export()
}
@function
def example() -> dagger.Container:
return (
dag.docker()
.cli()
.image()
.export()
)
@func()
example(): Container {
return dag
.docker()
.cli()
.image()
.export()
}
push() 🔗
Push this image to a registry
Return Type
String !
Example
dagger -m github.com/shykes/daggerverse/docker@fefb66deaa228f884be6ea03d2ffa7f8f4fbc868 call \
cli \
image \
push
func (m *myModule) example(ctx context.Context) string {
return dag.
Docker().
Cli().
Image().
Push(ctx)
}
@function
async def example() -> str:
return await (
dag.docker()
.cli()
.image()
.push()
)
@func()
async example(): Promise<string> {
return dag
.docker()
.cli()
.image()
.push()
}
ref() 🔗
Return the image’s ref (remote address)
Return Type
String !
Example
dagger -m github.com/shykes/daggerverse/docker@fefb66deaa228f884be6ea03d2ffa7f8f4fbc868 call \
cli \
image \
ref
func (m *myModule) example(ctx context.Context) string {
return dag.
Docker().
Cli().
Image().
Ref(ctx)
}
@function
async def example() -> str:
return await (
dag.docker()
.cli()
.image()
.ref()
)
@func()
async example(): Promise<string> {
return dag
.docker()
.cli()
.image()
.ref()
}