class Directory extends AbstractObject implements IdAble

A directory.

Properties

$lastQuery from  AbstractObject

Methods

__construct(AbstractClient $client, QueryBuilderChain $queryBuilderChain)

No description

null|array|string|int|float|bool
queryLeaf(QueryBuilder $leafQueryBuilder, string $leafKey)

No description

asGit()

Converts this directory to a local git repository

asModule(string|null $sourceRootPath = '.')

Load the directory as a Dagger module source

asModuleSource(string|null $sourceRootPath = '.')

Load the directory as a Dagger module source

diff(Directory $other)

Return the difference between this directory and an another directory. The difference is encoded as a directory.

string
digest()

Return the directory's digest. The format of the digest is not guaranteed to be stable between releases of Dagger. It is guaranteed to be stable between invocations of the same Dagger engine.

directory(string $path)

Retrieves a directory at the given path.

dockerBuild(string|null $dockerfile = 'Dockerfile', Platform|null $platform = null, array|null $buildArgs = null, string|null $target = '', array|null $secrets = null, bool|null $noInit = false)

Use Dockerfile compatibility to build a container from this directory. Only use this function for Dockerfile compatibility. Otherwise use the native Container type directly, it is feature-complete and supports all Dockerfile features.

array
entries(string|null $path = null)

Returns a list of files and directories at the given path.

bool
exists(string $path, ExistsType|null $expectedType = null, bool|null $doNotFollowSymlinks = false)

check if a file or directory exists

string
export(string $path, bool|null $wipe = false)

Writes the contents of the directory to a path on the host.

file(string $path)

Retrieve a file at the given path.

filter(array|null $exclude = null, array|null $include = null)

Return a snapshot with some paths included or excluded

array
glob(string $pattern)

Returns a list of files and directories that matche the given pattern.

id()

A unique identifier for this Directory.

string
name()

Returns the name of the directory.

sync()

Force evaluation in the engine.

terminal(Container|null $container = null, array|null $cmd = null, bool|null $experimentalPrivilegedNesting = false, bool|null $insecureRootCapabilities = false)

Opens an interactive terminal in new container with this directory mounted inside.

withDirectory(string $path, Directory $directory, array|null $exclude = null, array|null $include = null)

Return a snapshot with a directory added

withFile(string $path, File $source, int|null $permissions = null)

Retrieves this directory plus the contents of the given file copied to the given path.

withFiles(string $path, array $sources, int|null $permissions = null)

Retrieves this directory plus the contents of the given files copied to the given path.

withNewDirectory(string $path, int|null $permissions = 420)

Retrieves this directory plus a new directory created at the given path.

withNewFile(string $path, string $contents, int|null $permissions = 420)

Return a snapshot with a new file added

withPatch(string $patch)

Retrieves this directory with the given Git-compatible patch applied.

withSymlink(string $target, string $linkName)

Return a snapshot with a symlink

withTimestamps(int $timestamp)

Retrieves this directory with all file/dir timestamps set to the given time.

withoutDirectory(string $path)

Return a snapshot with a subdirectory removed

withoutFile(string $path)

Return a snapshot with a file removed

withoutFiles(array $paths)

Return a snapshot with files removed

Details

in AbstractObject at line 13
__construct(AbstractClient $client, QueryBuilderChain $queryBuilderChain)

No description

Parameters

AbstractClient $client
QueryBuilderChain $queryBuilderChain

in AbstractObject at line 19
protected null|array|string|int|float|bool queryLeaf(QueryBuilder $leafQueryBuilder, string $leafKey)

No description

Parameters

QueryBuilder $leafQueryBuilder
string $leafKey

Return Value

null|array|string|int|float|bool

at line 19
GitRepository asGit()

Converts this directory to a local git repository

Return Value

GitRepository

at line 28
Module asModule(string|null $sourceRootPath = '.')

Load the directory as a Dagger module source

Parameters

string|null $sourceRootPath

Return Value

Module

at line 40
ModuleSource asModuleSource(string|null $sourceRootPath = '.')

Load the directory as a Dagger module source

Parameters

string|null $sourceRootPath

Return Value

ModuleSource

at line 52
Directory diff(Directory $other)

Return the difference between this directory and an another directory. The difference is encoded as a directory.

Parameters

Directory $other

Return Value

Directory

at line 62
string digest()

Return the directory's digest. The format of the digest is not guaranteed to be stable between releases of Dagger. It is guaranteed to be stable between invocations of the same Dagger engine.

Return Value

string

at line 71
Directory directory(string $path)

Retrieves a directory at the given path.

Parameters

string $path

Return Value

Directory

at line 81
Container dockerBuild(string|null $dockerfile = 'Dockerfile', Platform|null $platform = null, array|null $buildArgs = null, string|null $target = '', array|null $secrets = null, bool|null $noInit = false)

Use Dockerfile compatibility to build a container from this directory. Only use this function for Dockerfile compatibility. Otherwise use the native Container type directly, it is feature-complete and supports all Dockerfile features.

Parameters

string|null $dockerfile
Platform|null $platform
array|null $buildArgs
string|null $target
array|null $secrets
bool|null $noInit

Return Value

Container

at line 114
array entries(string|null $path = null)

Returns a list of files and directories at the given path.

Parameters

string|null $path

Return Value

array

at line 126
bool exists(string $path, ExistsType|null $expectedType = null, bool|null $doNotFollowSymlinks = false)

check if a file or directory exists

Parameters

string $path
ExistsType|null $expectedType
bool|null $doNotFollowSymlinks

Return Value

bool

at line 142
string export(string $path, bool|null $wipe = false)

Writes the contents of the directory to a path on the host.

Parameters

string $path
bool|null $wipe

Return Value

string

at line 155
File file(string $path)

Retrieve a file at the given path.

Parameters

string $path

Return Value

File

at line 165
Directory filter(array|null $exclude = null, array|null $include = null)

Return a snapshot with some paths included or excluded

Parameters

array|null $exclude
array|null $include

Return Value

Directory

at line 180
array glob(string $pattern)

Returns a list of files and directories that matche the given pattern.

Parameters

string $pattern

Return Value

array

at line 190
AbstractId id()

A unique identifier for this Directory.

Return Value

AbstractId

at line 199
string name()

Returns the name of the directory.

Return Value

string

at line 208
DirectoryId sync()

Force evaluation in the engine.

Return Value

DirectoryId

at line 217
Directory terminal(Container|null $container = null, array|null $cmd = null, bool|null $experimentalPrivilegedNesting = false, bool|null $insecureRootCapabilities = false)

Opens an interactive terminal in new container with this directory mounted inside.

Parameters

Container|null $container
array|null $cmd
bool|null $experimentalPrivilegedNesting
bool|null $insecureRootCapabilities

Return Value

Directory

at line 242
Directory withDirectory(string $path, Directory $directory, array|null $exclude = null, array|null $include = null)

Return a snapshot with a directory added

Parameters

string $path
Directory $directory
array|null $exclude
array|null $include

Return Value

Directory

at line 263
Directory withFile(string $path, File $source, int|null $permissions = null)

Retrieves this directory plus the contents of the given file copied to the given path.

Parameters

string $path
File $source
int|null $permissions

Return Value

Directory

at line 277
Directory withFiles(string $path, array $sources, int|null $permissions = null)

Retrieves this directory plus the contents of the given files copied to the given path.

Parameters

string $path
array $sources
int|null $permissions

Return Value

Directory

at line 291
Directory withNewDirectory(string $path, int|null $permissions = 420)

Retrieves this directory plus a new directory created at the given path.

Parameters

string $path
int|null $permissions

Return Value

Directory

at line 304
Directory withNewFile(string $path, string $contents, int|null $permissions = 420)

Return a snapshot with a new file added

Parameters

string $path
string $contents
int|null $permissions

Return Value

Directory

at line 318
Directory withPatch(string $patch)

Retrieves this directory with the given Git-compatible patch applied.

Parameters

string $patch

Return Value

Directory

Return a snapshot with a symlink

Parameters

string $target
string $linkName

Return Value

Directory

at line 339
Directory withTimestamps(int $timestamp)

Retrieves this directory with all file/dir timestamps set to the given time.

Parameters

int $timestamp

Return Value

Directory

at line 349
Directory withoutDirectory(string $path)

Return a snapshot with a subdirectory removed

Parameters

string $path

Return Value

Directory

at line 359
Directory withoutFile(string $path)

Return a snapshot with a file removed

Parameters

string $path

Return Value

Directory

at line 369
Directory withoutFiles(array $paths)

Return a snapshot with files removed

Parameters

array $paths

Return Value

Directory