Client
Automatically generated client from Dagger API.
- class dagger.api.gen.CacheVolume(ctx: Context)[source]
A directory whose contents persist across runs
- class dagger.api.gen.Client(ctx: Context)[source]
- cache_volume(key: str) CacheVolume [source]
Construct a cache volume for a given cache key
- container(id: Optional[Union[ContainerID, Container]] = None, platform: Optional[Platform] = None) Container [source]
Load a container from ID.
Null ID returns an empty container (scratch).
Optional platform argument initializes new containers to execute and publish as that platform. Platform defaults to that of the builder’s host.
- class dagger.api.gen.Container(ctx: Context)[source]
An OCI-compatible container, also known as a docker container
- build(context: Directory, dockerfile: Optional[str] = None) Container [source]
Initialize this container from a Dockerfile build
- directory(path: str) Directory [source]
Retrieve a directory at the given path. Mounts are included.
- async entrypoint() list[str] | None [source]
Entrypoint to be prepended to the arguments of all commands
- async env_variable(name: str) str | None [source]
The value of the specified environment variable
- Returns
The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
- Return type
str | None
- env_variables() EnvVariable [source]
A list of environment variables passed to commands
- exec(args: Optional[list[str]] = None, stdin: Optional[str] = None, redirect_stdout: Optional[str] = None, redirect_stderr: Optional[str] = None, experimental_privileged_nesting: Optional[bool] = None) Container [source]
This container after executing the specified command inside it
Deprecated
Replaced by
with_exec()
.- Parameters
args – Command to run instead of the container’s default command
stdin – Content to write to the command’s standard input before closing
redirect_stdout – Redirect the command’s standard output to a file in the container
redirect_stderr – Redirect the command’s standard error to a file in the container
experimental_privileged_nesting – Provide dagger access to the executed command Do not use this option unless you trust the command being executed The command being executed WILL BE GRANTED FULL ACCESS TO YOUR HOST FILESYSTEM
- async exit_code() int | None [source]
Exit code of the last executed command. Zero means success.
Null if no command has been executed.
- Returns
The Int scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.
- Return type
int | None
- async export(path: str, platform_variants: Optional[list[dagger.api.gen.Container]] = None) bool [source]
Write the container as an OCI tarball to the destination file path on the host
- Returns
The Boolean scalar type represents true or false.
- Return type
- from_(address: str) Container [source]
Initialize this container from the base image published at the given address
- fs() Directory [source]
This container’s root filesystem. Mounts are not included.
Deprecated
Replaced by
rootfs()
.
- async id() ContainerID [source]
A unique identifier for this container
Note
This is lazyly evaluated, no operation is actually run.
- Returns
A unique container identifier. Null designates an empty container (scratch).
- Return type
ContainerID
- async publish(address: str, platform_variants: Optional[list[dagger.api.gen.Container]] = None) str [source]
Publish this container as a new image, returning a fully qualified ref
- Returns
The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
- Return type
- async stderr() str | None [source]
The error stream of the last executed command.
Null if no command has been executed.
- Returns
The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
- Return type
str | None
- async stdout() str | None [source]
The output stream of the last executed command.
Null if no command has been executed.
- Returns
The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
- Return type
str | None
- async user() str | None [source]
The user to be set for all commands
- Returns
The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
- Return type
str | None
- with_default_args(args: Optional[list[str]] = None) Container [source]
Configures default arguments for future commands
- with_entrypoint(args: list[str]) Container [source]
This container but with a different command entrypoint
- with_env_variable(name: str, value: str) Container [source]
This container plus the given environment variable
- with_exec(args: list[str], stdin: Optional[str] = None, redirect_stdout: Optional[str] = None, redirect_stderr: Optional[str] = None, experimental_privileged_nesting: Optional[bool] = None) Container [source]
This container after executing the specified command inside it
- Parameters
args – Command to run instead of the container’s default command
stdin – Content to write to the command’s standard input before closing
redirect_stdout – Redirect the command’s standard output to a file in the container
redirect_stderr – Redirect the command’s standard error to a file in the container
experimental_privileged_nesting – Provide dagger access to the executed command Do not use this option unless you trust the command being executed The command being executed WILL BE GRANTED FULL ACCESS TO YOUR HOST FILESYSTEM
- with_fs(id: Union[DirectoryID, Directory]) Container [source]
Initialize this container from this DirectoryID
Deprecated
Replaced by
with_rootfs()
.
- with_mounted_cache(path: str, cache: CacheVolume, source: Optional[Directory] = None) Container [source]
This container plus a cache volume mounted at the given path
- with_mounted_directory(path: str, source: Directory) Container [source]
This container plus a directory mounted at the given path
- with_mounted_file(path: str, source: File) Container [source]
This container plus a file mounted at the given path
- with_mounted_secret(path: str, source: Secret) Container [source]
This container plus a secret mounted into a file at the given path
- with_mounted_temp(path: str) Container [source]
This container plus a temporary directory mounted at the given path
- with_rootfs(id: Union[DirectoryID, Directory]) Container [source]
Initialize this container from this DirectoryID
- with_secret_variable(name: str, secret: Secret) Container [source]
This container plus an env variable containing the given secret
- without_env_variable(name: str) Container [source]
This container minus the given environment variable
- dagger.api.gen.ContainerID
A unique container identifier. Null designates an empty container (scratch).
alias of
str
- class dagger.api.gen.Directory(ctx: Context)[source]
A directory
- diff(other: Directory) Directory [source]
The difference between this directory and an another directory
- async entries(path: Optional[str] = None) list[str] [source]
Return a list of files and directories at the given path
- async export(path: str) bool [source]
Write the contents of the directory to a path on the host
- Returns
The Boolean scalar type represents true or false.
- Return type
- async id() DirectoryID [source]
The content-addressed identifier of the directory
Note
This is lazyly evaluated, no operation is actually run.
- Returns
A content-addressed directory identifier
- Return type
DirectoryID
- with_directory(path: str, directory: Directory, exclude: Optional[list[str]] = None, include: Optional[list[str]] = None) Directory [source]
This directory plus a directory written at the given path
- with_file(path: str, source: File) Directory [source]
This directory plus the contents of the given file copied to the given path
- with_new_directory(path: str) Directory [source]
This directory plus a new directory created at the given path
- with_new_file(path: str, contents: str) Directory [source]
This directory plus a new file written at the given path
- class dagger.api.gen.EnvVariable(ctx: Context)[source]
EnvVariable is a simple key value object that represents an environment variable.
- class dagger.api.gen.File(ctx: Context)[source]
A file
- async contents() str [source]
The contents of the file
- Returns
The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
- Return type
- async export(path: str) bool [source]
Write the file to a file path on the host
- Returns
The Boolean scalar type represents true or false.
- Return type
- class dagger.api.gen.GitRef(ctx: Context)[source]
A git ref (tag or branch)
- class dagger.api.gen.GitRepository(ctx: Context)[source]
A git repository
- class dagger.api.gen.Host(ctx: Context)[source]
Information about the host execution environment
- directory(path: str, exclude: Optional[list[str]] = None, include: Optional[list[str]] = None) Directory [source]
Access a directory on the host
- env_variable(name: str) HostVariable [source]
Lookup the value of an environment variable. Null if the variable is not available.
- class dagger.api.gen.HostVariable(ctx: Context)[source]
An environment variable on the host environment
- class dagger.api.gen.Project(ctx: Context)[source]
A set of scripts and/or extensions
- async install() bool [source]
install the project’s schema
- Returns
The Boolean scalar type represents true or false.
- Return type
- async name() str [source]
name of the project
- Returns
The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
- Return type
- async schema() str | None [source]
schema provided by the project
- Returns
The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
- Return type
str | None
- async sdk() str | None [source]
sdk used to generate code for and/or execute this project
- Returns
The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
- Return type
str | None
- class dagger.api.gen.Secret(ctx: Context)[source]
A reference to a secret value, which can be handled more safely than the value itself