Back to Dagger

Container

docs/static/reference/php/Dagger/Container.html

0.20.740.2 KB
Original Source

Container

class Container extends AbstractObject implements IdAble

An OCI-compatible container, also known as a Docker container.

Properties

| | $lastQuery | | from AbstractObject |

Methods

__construct(AbstractClient $client, QueryBuilderChain $queryBuilderChain)

No description

from AbstractObject

null|array|string|int|float|bool

queryLeaf(QueryBuilder $leafQueryBuilder, string $leafKey)

No description

from AbstractObject

Service

asService(array|null $args = null, bool|null $useEntrypoint = false, bool|null $experimentalPrivilegedNesting = false, bool|null $insecureRootCapabilities = false, bool|null $expand = false, bool|null $noInit = false)

Turn the container into a Service.

File

asTarball(array|null $platformVariants = null, ImageLayerCompression|null $forcedCompression = null, ImageMediaTypes|null $mediaTypes = null)

Package the container state as an OCI image, and return it as a tar archive

string

combinedOutput()

The combined buffered standard output and standard error stream of the last executed command

array

defaultArgs()

Return the container's default arguments.

Directory

directory(string $path, bool|null $expand = false)

Retrieve a directory from the container's root filesystem

HealthcheckConfig

dockerHealthcheck()

Retrieves this container's configured docker healthcheck.

array

entrypoint()

Return the container's OCI entrypoint.

string

envVariable(string $name)

Retrieves the value of the specified environment variable.

array

envVariables()

Retrieves the list of environment variables passed to commands.

bool

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

check if a file or directory exists

int

exitCode()

The exit code of the last executed command

Container

experimentalWithAllGPUs()

EXPERIMENTAL API! Subject to change/removal at any time.

Container

experimentalWithGPU(array $devices)

EXPERIMENTAL API! Subject to change/removal at any time.

string

export(string $path, array|null $platformVariants = null, ImageLayerCompression|null $forcedCompression = null, ImageMediaTypes|null $mediaTypes = null, bool|null $expand = false)

Writes the container as an OCI tarball to the destination file path on the host.

void

exportImage(string $name, array|null $platformVariants = null, ImageLayerCompression|null $forcedCompression = null, ImageMediaTypes|null $mediaTypes = null)

Exports the container as an image to the host's container image store.

array

exposedPorts()

Retrieves the list of exposed ports.

File

file(string $path, bool|null $expand = false)

Retrieves a file at the given path.

Container

from(string $address)

Download a container image, and apply it to the container state. All previous state will be lost.

AbstractId

id()

A unique identifier for this Container.

string

imageRef()

The unique image reference which can only be retrieved immediately after the 'Container.From' call.

Container

import(File $source, string|null $tag = '')

Reads the container from an OCI tarball.

string

label(string $name)

Retrieves the value of the specified label.

array

labels()

Retrieves the list of labels passed to container.

array

mounts()

Retrieves the list of paths where a directory is mounted.

Platform

platform()

The platform this container executes and publishes as.

string

publish(string $address, array|null $platformVariants = null, ImageLayerCompression|null $forcedCompression = null, ImageMediaTypes|null $mediaTypes = null)

Package the container state as an OCI image, and publish it to a registry

Directory

rootfs()

Return a snapshot of the container's root filesystem. The snapshot can be modified then written back using withRootfs. Use that method for filesystem modifications.

Stat

stat(string $path, bool|null $doNotFollowSymlinks = false)

Return file status

string

stderr()

The buffered standard error stream of the last executed command

string

stdout()

The buffered standard output stream of the last executed command

ContainerId

sync()

Forces evaluation of the pipeline in the engine.

Container

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

Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).

void

up(bool|null $random = false, array|null $ports = null, array|null $args = null, bool|null $useEntrypoint = false, bool|null $experimentalPrivilegedNesting = false, bool|null $insecureRootCapabilities = false, bool|null $expand = false, bool|null $noInit = false)

Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.

string

user()

Retrieves the user to be set for all commands.

Container

withAnnotation(string $name, string $value)

Retrieves this container plus the given OCI annotation.

Container

withDefaultArgs(array $args)

Configures default arguments for future commands. Like CMD in Dockerfile.

Container

withDefaultTerminalCmd(array $args, bool|null $experimentalPrivilegedNesting = false, bool|null $insecureRootCapabilities = false)

Set the default command to invoke for the container's terminal API.

Container

withDirectory(string $path, Directory $source, array|null $exclude = null, array|null $include = null, bool|null $gitignore = false, string|null $owner = '', bool|null $expand = false)

Return a new container snapshot, with a directory added to its filesystem

Container

withDockerHealthcheck(array $args, bool|null $shell = null, string|null $interval = null, string|null $timeout = null, string|null $startPeriod = null, string|null $startInterval = null, int|null $retries = null)

Retrieves this container with the specificed docker healtcheck command set.

Container

withEntrypoint(array $args, bool|null $keepDefaultArgs = false)

Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.

Container

withEnvFileVariables(EnvFile $source)

Export environment variables from an env-file to the container.

Container

withEnvVariable(string $name, string $value, bool|null $expand = false)

Set a new environment variable in the container.

Container

withError(string $err)

Raise an error.

Container

withExec(array $args, bool|null $useEntrypoint = false, string|null $stdin = '', string|null $redirectStdin = '', string|null $redirectStdout = '', string|null $redirectStderr = '', ReturnType|null $expect = null, bool|null $experimentalPrivilegedNesting = false, bool|null $insecureRootCapabilities = false, bool|null $expand = false, bool|null $noInit = false)

Execute a command in the container, and return a new snapshot of the container state after execution.

Container

withExposedPort(int $port, NetworkProtocol|null $protocol = null, string|null $description = null, bool|null $experimentalSkipHealthcheck = false)

Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)

Container

withFile(string $path, File $source, int|null $permissions = null, string|null $owner = '', bool|null $expand = false)

Return a container snapshot with a file added

Container

withFiles(string $path, array $sources, int|null $permissions = null, string|null $owner = '', bool|null $expand = false)

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

Container

withLabel(string $name, string $value)

Retrieves this container plus the given label.

Container

withMountedCache(string $path, CacheVolume $cache, Directory|null $source = null, CacheSharingMode|null $sharing = null, string|null $owner = '', bool|null $expand = false)

Retrieves this container plus a cache volume mounted at the given path.

Container

withMountedDirectory(string $path, Directory $source, string|null $owner = '', bool|null $expand = false)

Retrieves this container plus a directory mounted at the given path.

Container

withMountedFile(string $path, File $source, string|null $owner = '', bool|null $expand = false)

Retrieves this container plus a file mounted at the given path.

Container

withMountedSecret(string $path, Secret $source, string|null $owner = '', int|null $mode = 256, bool|null $expand = false)

Retrieves this container plus a secret mounted into a file at the given path.

Container

withMountedTemp(string $path, int|null $size = null, bool|null $expand = false)

Retrieves this container plus a temporary directory mounted at the given path. Any writes will be ephemeral to a single withExec call; they will not be persisted to subsequent withExecs.

Container

withNewFile(string $path, string $contents, int|null $permissions = 420, string|null $owner = '', bool|null $expand = false)

Return a new container snapshot, with a file added to its filesystem with text content

Container

withRegistryAuth(string $address, string $username, Secret $secret)

Attach credentials for future publishing to a registry. Use in combination with publish

Container

withRootfs(Directory $directory)

Change the container's root filesystem. The previous root filesystem will be lost.

Container

withSecretVariable(string $name, Secret $secret)

Set a new environment variable, using a secret value

Container

withServiceBinding(string $alias, Service $service)

Establish a runtime dependency from a container to a network service.

Container

withSymlink(string $target, string $linkName, bool|null $expand = false)

Return a snapshot with a symlink

Container

withUnixSocket(string $path, Socket $source, string|null $owner = '', bool|null $expand = false)

Retrieves this container plus a socket forwarded to the given Unix socket path.

Container

withUser(string $name)

Retrieves this container with a different command user.

Container

withWorkdir(string $path, bool|null $expand = false)

Change the container's working directory. Like WORKDIR in Dockerfile.

Container

withoutAnnotation(string $name)

Retrieves this container minus the given OCI annotation.

Container

withoutDefaultArgs()

Remove the container's default arguments.

Container

withoutDirectory(string $path, bool|null $expand = false)

Return a new container snapshot, with a directory removed from its filesystem

Container

withoutDockerHealthcheck()

Retrieves this container without a configured docker healtcheck command.

Container

withoutEntrypoint(bool|null $keepDefaultArgs = false)

Reset the container's OCI entrypoint.

Container

withoutEnvVariable(string $name)

Retrieves this container minus the given environment variable.

Container

withoutExposedPort(int $port, NetworkProtocol|null $protocol = null)

Unexpose a previously exposed port.

Container

withoutFile(string $path, bool|null $expand = false)

Retrieves this container with the file at the given path removed.

Container

withoutFiles(array $paths, bool|null $expand = false)

Return a new container spanshot with specified files removed

Container

withoutLabel(string $name)

Retrieves this container minus the given environment label.

Container

withoutMount(string $path, bool|null $expand = false)

Retrieves this container after unmounting everything at the given path.

Container

withoutRegistryAuth(string $address)

Retrieves this container without the registry authentication of a given address.

Container

withoutSecretVariable(string $name)

Retrieves this container minus the given environment variable containing the secret.

Container

withoutUnixSocket(string $path, bool|null $expand = false)

Retrieves this container with a previously added Unix socket removed.

Container

withoutUser()

Retrieves this container with an unset command user.

Container

withoutWorkdir()

Unset the container's working directory.

string

workdir()

Retrieves the working directory for all commands.

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 21 Service asService(array|null $args = null, bool|null $useEntrypoint = false, bool|null $experimentalPrivilegedNesting = false, bool|null $insecureRootCapabilities = false, bool|null $expand = false, bool|null $noInit = false)

Turn the container into a Service.

Be sure to set any exposed ports before this conversion.

Parameters

| array|null | $args | | | bool|null | $useEntrypoint | | | bool|null | $experimentalPrivilegedNesting | | | bool|null | $insecureRootCapabilities | | | bool|null | $expand | | | bool|null | $noInit | |

Return Value

| Service | |

at line 54 File asTarball(array|null $platformVariants = null, ImageLayerCompression|null $forcedCompression = null, ImageMediaTypes|null $mediaTypes = null)

Package the container state as an OCI image, and return it as a tar archive

Parameters

| array|null | $platformVariants | | | ImageLayerCompression|null | $forcedCompression | | | ImageMediaTypes|null | $mediaTypes | |

Return Value

| File | |

at line 77 string combinedOutput()

The combined buffered standard output and standard error stream of the last executed command

Returns an error if no command was executed

Return Value

| string | |

at line 86 array defaultArgs()

Return the container's default arguments.

Return Value

| array | |

at line 97 Directory directory(string $path, bool|null $expand = false)

Retrieve a directory from the container's root filesystem

Mounts are included.

Parameters

| string | $path | | | bool|null | $expand | |

Return Value

| Directory | |

at line 110 HealthcheckConfig dockerHealthcheck()

Retrieves this container's configured docker healthcheck.

Return Value

| HealthcheckConfig | |

at line 119 array entrypoint()

Return the container's OCI entrypoint.

Return Value

| array | |

at line 128 string envVariable(string $name)

Retrieves the value of the specified environment variable.

Parameters

| string | $name | |

Return Value

| string | |

at line 138 array envVariables()

Retrieves the list of environment variables passed to commands.

Return Value

| array | |

check if a file or directory exists

Parameters

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

Return Value

| bool | |

at line 165 int exitCode()

The exit code of the last executed command

Returns an error if no command was executed

Return Value

| int | |

at line 178 Container experimentalWithAllGPUs()

EXPERIMENTAL API! Subject to change/removal at any time.

Configures all available GPUs on the host to be accessible to this container.

This currently works for Nvidia devices only.

Return Value

| Container | |

at line 191 Container experimentalWithGPU(array $devices)

EXPERIMENTAL API! Subject to change/removal at any time.

Configures the provided list of devices to be accessible to this container.

This currently works for Nvidia devices only.

Parameters

| array | $devices | |

Return Value

| Container | |

at line 203 string export(string $path, array|null $platformVariants = null, ImageLayerCompression|null $forcedCompression = null, ImageMediaTypes|null $mediaTypes = null, bool|null $expand = false)

Writes the container as an OCI tarball to the destination file path on the host.

It can also export platform variants.

Parameters

| string | $path | | | array|null | $platformVariants | | | ImageLayerCompression|null | $forcedCompression | | | ImageMediaTypes|null | $mediaTypes | | | bool|null | $expand | |

Return Value

| string | |

at line 230 void exportImage(string $name, array|null $platformVariants = null, ImageLayerCompression|null $forcedCompression = null, ImageMediaTypes|null $mediaTypes = null)

Exports the container as an image to the host's container image store.

Parameters

| string | $name | | | array|null | $platformVariants | | | ImageLayerCompression|null | $forcedCompression | | | ImageMediaTypes|null | $mediaTypes | |

Return Value

| void | |

at line 255 array exposedPorts()

Retrieves the list of exposed ports.

This includes ports already exposed by the image, even if not explicitly added with dagger.

Return Value

| array | |

at line 266 File file(string $path, bool|null $expand = false)

Retrieves a file at the given path.

Mounts are included.

Parameters

| string | $path | | | bool|null | $expand | |

Return Value

| File | |

at line 279 Container from(string $address)

Download a container image, and apply it to the container state. All previous state will be lost.

Parameters

| string | $address | |

Return Value

| Container | |

at line 289 AbstractId id()

A unique identifier for this Container.

Return Value

| AbstractId | |

at line 298 string imageRef()

The unique image reference which can only be retrieved immediately after the 'Container.From' call.

Return Value

| string | |

at line 307 Container import(File $source, string|null $tag = '')

Reads the container from an OCI tarball.

Parameters

| File | $source | | | string|null | $tag | |

Return Value

| Container | |

at line 320 string label(string $name)

Retrieves the value of the specified label.

Parameters

| string | $name | |

Return Value

| string | |

at line 330 array labels()

Retrieves the list of labels passed to container.

Return Value

| array | |

at line 339 array mounts()

Retrieves the list of paths where a directory is mounted.

Return Value

| array | |

at line 348 Platform platform()

The platform this container executes and publishes as.

Return Value

| Platform | |

at line 359 string publish(string $address, array|null $platformVariants = null, ImageLayerCompression|null $forcedCompression = null, ImageMediaTypes|null $mediaTypes = null)

Package the container state as an OCI image, and publish it to a registry

Returns the fully qualified address of the published image, with digest

Parameters

| string | $address | | | array|null | $platformVariants | | | ImageLayerCompression|null | $forcedCompression | | | ImageMediaTypes|null | $mediaTypes | |

Return Value

| string | |

at line 382 Directory rootfs()

Return a snapshot of the container's root filesystem. The snapshot can be modified then written back using withRootfs. Use that method for filesystem modifications.

Return Value

| Directory | |

Return file status

Parameters

| string | $path | | | bool|null | $doNotFollowSymlinks | |

Return Value

| Stat | |

at line 406 string stderr()

The buffered standard error stream of the last executed command

Returns an error if no command was executed

Return Value

| string | |

at line 417 string stdout()

The buffered standard output stream of the last executed command

Returns an error if no command was executed

Return Value

| string | |

at line 428 ContainerId sync()

Forces evaluation of the pipeline in the engine.

It doesn't run the default command if no exec has been set.

Return Value

| ContainerId | |

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

Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).

Parameters

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

Return Value

| Container | |

at line 460 void up(bool|null $random = false, array|null $ports = null, array|null $args = null, bool|null $useEntrypoint = false, bool|null $experimentalPrivilegedNesting = false, bool|null $insecureRootCapabilities = false, bool|null $expand = false, bool|null $noInit = false)

Starts a Service and creates a tunnel that forwards traffic from the caller's network to that service.

Be sure to set any exposed ports before calling this api.

Parameters

| bool|null | $random | | | array|null | $ports | | | array|null | $args | | | bool|null | $useEntrypoint | | | bool|null | $experimentalPrivilegedNesting | | | bool|null | $insecureRootCapabilities | | | bool|null | $expand | | | bool|null | $noInit | |

Return Value

| void | |

at line 501 string user()

Retrieves the user to be set for all commands.

Return Value

| string | |

at line 510 Container withAnnotation(string $name, string $value)

Retrieves this container plus the given OCI annotation.

Parameters

| string | $name | | | string | $value | |

Return Value

| Container | |

at line 521 Container withDefaultArgs(array $args)

Configures default arguments for future commands. Like CMD in Dockerfile.

Parameters

| array | $args | |

Return Value

| Container | |

at line 531 Container withDefaultTerminalCmd(array $args, bool|null $experimentalPrivilegedNesting = false, bool|null $insecureRootCapabilities = false)

Set the default command to invoke for the container's terminal API.

Parameters

| array | $args | | | bool|null | $experimentalPrivilegedNesting | | | bool|null | $insecureRootCapabilities | |

Return Value

| Container | |

at line 550 Container withDirectory(string $path, Directory $source, array|null $exclude = null, array|null $include = null, bool|null $gitignore = false, string|null $owner = '', bool|null $expand = false)

Return a new container snapshot, with a directory added to its filesystem

Parameters

| string | $path | | | Directory | $source | | | array|null | $exclude | | | array|null | $include | | | bool|null | $gitignore | | | string|null | $owner | | | bool|null | $expand | |

Return Value

| Container | |

at line 583 Container withDockerHealthcheck(array $args, bool|null $shell = null, string|null $interval = null, string|null $timeout = null, string|null $startPeriod = null, string|null $startInterval = null, int|null $retries = null)

Retrieves this container with the specificed docker healtcheck command set.

Parameters

| array | $args | | | bool|null | $shell | | | string|null | $interval | | | string|null | $timeout | | | string|null | $startPeriod | | | string|null | $startInterval | | | int|null | $retries | |

Return Value

| Container | |

at line 618 Container withEntrypoint(array $args, bool|null $keepDefaultArgs = false)

Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.

Parameters

| array | $args | | | bool|null | $keepDefaultArgs | |

Return Value

| Container | |

at line 631 Container withEnvFileVariables(EnvFile $source)

Export environment variables from an env-file to the container.

Parameters

| EnvFile | $source | |

Return Value

| Container | |

at line 641 Container withEnvVariable(string $name, string $value, bool|null $expand = false)

Set a new environment variable in the container.

Parameters

| string | $name | | | string | $value | | | bool|null | $expand | |

Return Value

| Container | |

at line 655 Container withError(string $err)

Raise an error.

Parameters

| string | $err | |

Return Value

| Container | |

at line 665 Container withExec(array $args, bool|null $useEntrypoint = false, string|null $stdin = '', string|null $redirectStdin = '', string|null $redirectStdout = '', string|null $redirectStderr = '', ReturnType|null $expect = null, bool|null $experimentalPrivilegedNesting = false, bool|null $insecureRootCapabilities = false, bool|null $expand = false, bool|null $noInit = false)

Execute a command in the container, and return a new snapshot of the container state after execution.

Parameters

| array | $args | | | bool|null | $useEntrypoint | | | string|null | $stdin | | | string|null | $redirectStdin | | | string|null | $redirectStdout | | | string|null | $redirectStderr | | | ReturnType|null | $expect | | | bool|null | $experimentalPrivilegedNesting | | | bool|null | $insecureRootCapabilities | | | bool|null | $expand | | | bool|null | $noInit | |

Return Value

| Container | |

at line 722 Container withExposedPort(int $port, NetworkProtocol|null $protocol = null, string|null $description = null, bool|null $experimentalSkipHealthcheck = false)

Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)

Exposed ports serve two purposes:

  • For health checks and introspection, when running services

  • For setting the EXPOSE OCI field when publishing the container

Parameters

| int | $port | | | NetworkProtocol|null | $protocol | | | string|null | $description | | | bool|null | $experimentalSkipHealthcheck | |

Return Value

| Container | |

at line 745 Container withFile(string $path, File $source, int|null $permissions = null, string|null $owner = '', bool|null $expand = false)

Return a container snapshot with a file added

Parameters

| string | $path | | | File | $source | | | int|null | $permissions | | | string|null | $owner | | | bool|null | $expand | |

Return Value

| Container | |

at line 770 Container withFiles(string $path, array $sources, int|null $permissions = null, string|null $owner = '', bool|null $expand = false)

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

Parameters

| string | $path | | | array | $sources | | | int|null | $permissions | | | string|null | $owner | | | bool|null | $expand | |

Return Value

| Container | |

at line 795 Container withLabel(string $name, string $value)

Retrieves this container plus the given label.

Parameters

| string | $name | | | string | $value | |

Return Value

| Container | |

at line 806 Container withMountedCache(string $path, CacheVolume $cache, Directory|null $source = null, CacheSharingMode|null $sharing = null, string|null $owner = '', bool|null $expand = false)

Retrieves this container plus a cache volume mounted at the given path.

Parameters

| string | $path | | | CacheVolume | $cache | | | Directory|null | $source | | | CacheSharingMode|null | $sharing | | | string|null | $owner | | | bool|null | $expand | |

Return Value

| Container | |

at line 835 Container withMountedDirectory(string $path, Directory $source, string|null $owner = '', bool|null $expand = false)

Retrieves this container plus a directory mounted at the given path.

Parameters

| string | $path | | | Directory | $source | | | string|null | $owner | | | bool|null | $expand | |

Return Value

| Container | |

at line 856 Container withMountedFile(string $path, File $source, string|null $owner = '', bool|null $expand = false)

Retrieves this container plus a file mounted at the given path.

Parameters

| string | $path | | | File | $source | | | string|null | $owner | | | bool|null | $expand | |

Return Value

| Container | |

at line 877 Container withMountedSecret(string $path, Secret $source, string|null $owner = '', int|null $mode = 256, bool|null $expand = false)

Retrieves this container plus a secret mounted into a file at the given path.

Parameters

| string | $path | | | Secret | $source | | | string|null | $owner | | | int|null | $mode | | | bool|null | $expand | |

Return Value

| Container | |

at line 902 Container withMountedTemp(string $path, int|null $size = null, bool|null $expand = false)

Retrieves this container plus a temporary directory mounted at the given path. Any writes will be ephemeral to a single withExec call; they will not be persisted to subsequent withExecs.

Parameters

| string | $path | | | int|null | $size | | | bool|null | $expand | |

Return Value

| Container | |

at line 918 Container withNewFile(string $path, string $contents, int|null $permissions = 420, string|null $owner = '', bool|null $expand = false)

Return a new container snapshot, with a file added to its filesystem with text content

Parameters

| string | $path | | | string | $contents | | | int|null | $permissions | | | string|null | $owner | | | bool|null | $expand | |

Return Value

| Container | |

at line 943 Container withRegistryAuth(string $address, string $username, Secret $secret)

Attach credentials for future publishing to a registry. Use in combination with publish

Parameters

| string | $address | | | string | $username | | | Secret | $secret | |

Return Value

| Container | |

at line 955 Container withRootfs(Directory $directory)

Change the container's root filesystem. The previous root filesystem will be lost.

Parameters

| Directory | $directory | |

Return Value

| Container | |

at line 965 Container withSecretVariable(string $name, Secret $secret)

Set a new environment variable, using a secret value

Parameters

| string | $name | | | Secret | $secret | |

Return Value

| Container | |

at line 982 Container withServiceBinding(string $alias, Service $service)

Establish a runtime dependency from a container to a network service.

The service will be started automatically when needed and detached when it is no longer needed, executing the default command if none is set.

The service will be reachable from the container via the provided hostname alias.

The service dependency will also convey to any files or directories produced by the container.

Parameters

| string | $alias | | | Service | $service | |

Return Value

| Container | |

Return a snapshot with a symlink

Parameters

| string | $target | | | string | $linkName | | | bool|null | $expand | |

Return Value

| Container | |

at line 1007 Container withUnixSocket(string $path, Socket $source, string|null $owner = '', bool|null $expand = false)

Retrieves this container plus a socket forwarded to the given Unix socket path.

Parameters

| string | $path | | | Socket | $source | | | string|null | $owner | | | bool|null | $expand | |

Return Value

| Container | |

at line 1028 Container withUser(string $name)

Retrieves this container with a different command user.

Parameters

| string | $name | |

Return Value

| Container | |

at line 1038 Container withWorkdir(string $path, bool|null $expand = false)

Change the container's working directory. Like WORKDIR in Dockerfile.

Parameters

| string | $path | | | bool|null | $expand | |

Return Value

| Container | |

at line 1051 Container withoutAnnotation(string $name)

Retrieves this container minus the given OCI annotation.

Parameters

| string | $name | |

Return Value

| Container | |

at line 1061 Container withoutDefaultArgs()

Remove the container's default arguments.

Return Value

| Container | |

at line 1070 Container withoutDirectory(string $path, bool|null $expand = false)

Return a new container snapshot, with a directory removed from its filesystem

Parameters

| string | $path | | | bool|null | $expand | |

Return Value

| Container | |

at line 1083 Container withoutDockerHealthcheck()

Retrieves this container without a configured docker healtcheck command.

Return Value

| Container | |

at line 1092 Container withoutEntrypoint(bool|null $keepDefaultArgs = false)

Reset the container's OCI entrypoint.

Parameters

| bool|null | $keepDefaultArgs | |

Return Value

| Container | |

at line 1104 Container withoutEnvVariable(string $name)

Retrieves this container minus the given environment variable.

Parameters

| string | $name | |

Return Value

| Container | |

at line 1114 Container withoutExposedPort(int $port, NetworkProtocol|null $protocol = null)

Unexpose a previously exposed port.

Parameters

| int | $port | | | NetworkProtocol|null | $protocol | |

Return Value

| Container | |

at line 1127 Container withoutFile(string $path, bool|null $expand = false)

Retrieves this container with the file at the given path removed.

Parameters

| string | $path | | | bool|null | $expand | |

Return Value

| Container | |

at line 1140 Container withoutFiles(array $paths, bool|null $expand = false)

Return a new container spanshot with specified files removed

Parameters

| array | $paths | | | bool|null | $expand | |

Return Value

| Container | |

at line 1153 Container withoutLabel(string $name)

Retrieves this container minus the given environment label.

Parameters

| string | $name | |

Return Value

| Container | |

at line 1163 Container withoutMount(string $path, bool|null $expand = false)

Retrieves this container after unmounting everything at the given path.

Parameters

| string | $path | | | bool|null | $expand | |

Return Value

| Container | |

at line 1176 Container withoutRegistryAuth(string $address)

Retrieves this container without the registry authentication of a given address.

Parameters

| string | $address | |

Return Value

| Container | |

at line 1186 Container withoutSecretVariable(string $name)

Retrieves this container minus the given environment variable containing the secret.

Parameters

| string | $name | |

Return Value

| Container | |

at line 1196 Container withoutUnixSocket(string $path, bool|null $expand = false)

Retrieves this container with a previously added Unix socket removed.

Parameters

| string | $path | | | bool|null | $expand | |

Return Value

| Container | |

at line 1211 Container withoutUser()

Retrieves this container with an unset command user.

Should default to root.

Return Value

| Container | |

at line 1222 Container withoutWorkdir()

Unset the container's working directory.

Should default to "/".

Return Value

| Container | |

at line 1231 string workdir()

Retrieves the working directory for all commands.

Return Value

| string | |

Generated by Doctum, a API Documentation generator and fork of Sami.