class Client

Container.

Constants

TYPE

Properties

array $ExposedPorts

Methods

setCmd(array|null $cmd = null)

No description

setImage(string $image)

No description

setContainerName(string $container_name)

No description

setNetworkingConfig(array $networkingConfig)

No description

setHostname(string $hostname)

No description

setDomainname(string $domainname)

No description

setUser(string $user)

No description

setAttachStdin(bool $attachStdin = false)

No description

setAttachStdout(bool $attachStdout = false)

No description

setAttachStderr(bool $attachStderr = false)

No description

setExposedPorts(array $exposedPorts)

No description

setTty(bool $tty = false)

No description

setOpenStdin(bool $openStdin = false)

No description

setStdinOnce(bool $stdinOnce = false)

No description

setEnv(array|null $env)

No description

setHealthcheck(array $test = [], int $interval = 0, int $timeout = 0, int $retries = 0, int $startPeriod = 0)

No description

setArgsEscaped(bool $argsEscaped = false)

Command is already escaped (Windows only).

setVolumes(array $volumes)

No description

setWorkingDir(string $workingDir)

No description

setEntrypoint(array|null $entrypoint = null)

No description

setNetworkDisabled(bool $networkDisabled = true)

Disable networking for the container.

setMacAddress(string $macAddress)

No description

setOnBuild(array $onBuild)

No description

setLabels(array $labels = ['k' => 'v'])

No description

setStopSignal(string $stopSignal = 'SIGTERM')

No description

setStopTimeout(int $stopTimeout = 10)

Timeout to stop a container in seconds.

setShell(array $shell)

No description

setCpuShares(int $cpuShares)

No description

setMemory(int $memory = 0)

Memory limit in bytes.

setCgroupParent(string $cgroupParent)

No description

setBlkioWeight(int $blkioWeight)

[ 0 .

setBlkioWeightDevice(array $blkioWeightDevice)

$param array $blkioWeightDevice.

setBlkioDeviceReadBps(array $blkioDeviceReadBps)

[{"Path": "device_path", "Rate": rate}].

setBlkioDeviceWriteBps(array $blkioDeviceWriteBps)

[{"Path": "device_path", "Rate": rate}].

setBlkioDeviceReadIOps(array $blkioDeviceReadIOps)

[{"Path": "device_path", "Rate": rate}].

setBlkioDeviceWriteIOps(array $blkioDeviceWriteIOps)

[{"Path": "device_path", "Rate": rate}].

setCpuPeriod(int $cpuPeriod)

The length of a CPU period in microseconds.

setCpuQuota(int $cpuQuota)

No description

setCpuRealtimePeriod(int $cpuRealtimePeriod)

No description

setCpuRealtimeRuntime(int $cpuRealtimeRuntime)

No description

setCpusetCpus(string $cpusetCpus)

No description

setCpusetMems(string $cpusetMems)

Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems.

setDevices(array $devices)

No description

setDeviceCgroupRules(array $deviceCgroupRules)

No description

setKernelMemory(int $kernelMemory)

Kernel memory limit in bytes.

setMemoryReservation(int $memoryReservation)

Memory soft limit in bytes.

setMemorySwap(int $memorySwap)

Total memory limit (memory + swap). Set as -1 to enable unlimited swap.

setMemorySwappiness(int $memorySwappiness)

[ 0 .

setNanoCPUs(int $nanoCPUs)

No description

setOomKillDisable(bool $oomKillDisable)

No description

setInit(bool|null $init)

No description

setPidsLimit(int|null $pidsLimit)

Tune a container's PIDs limit. Set 0 or -1 for unlimited, or null to not change.

setUlimits(array $ulimits)

{"Name": "nofile", "Soft": 1024, "Hard": 2048}.

setCpuCount(int $cpuCount)

The number of usable CPUs (Windows only).

setCpuPercent(int $cpuPercent)

The usable percentage of the available CPUs (Windows only).

setIOMaximumIOps(int $IOMaximumIOps)

Maximum IOps for the container system drive (Windows only).

setIOMaximumBandWidth(int $IOMaximumBandWidth)

Maximum IO in bytes per second for the container system drive (Windows only).

setBinds(array $binds)

No description

setContainerIDFile(string $containerIDFile)

No description

setLogConfig(array $logConfig)

No description

setNetworkMode(string $networkMode)

bridge, host, none, and container:<name|id>.

setPortBindings(array $portBindings)

No description

setRestartPolicy(array $restartPolicy)

"" "always" "unless-stopped" "on-failure".

setAutoRemove(bool $autoRemove)

Automatically remove the container when the container's process exits.

setVolumeDriver(string $volumeDriver)

Driver that this container uses to mount volumes.

setVolumesFrom(array $volumesFrom)

A list of volumes to inherit from another container, specified in the form [:<ro|rw>].

setMounts(array $mounts)

No description

setCapAdd(array $capAdd)

No description

setCapDrop(array $capDrop)

No description

setDns(array $dns)

No description

setDnsOptions(array $dnsOptions)

No description

setDnsSearch(array $dnsSearch)

No description

setExtraHosts(array $extraHosts)

No description

setGroupAdd(array $groupAdd)

No description

setIpcMode(string $ipcMode)

No description

setCgroup(string $Cgroup)

Cgroup to use for the container.

setOomScoreAdj(int $oomScoreAdj)

No description

setPidMode(string $pidMode)

"container:<name|id>" | "host".

setPrivileged(bool $privileged)

No description

setPublishAllPorts(bool $publishAllPorts)

No description

setReadonlyRootfs(bool $readonlyRootfs)

No description

setSecurityOpt(array $securityOpt)

No description

setStorageOpt(array $storageOpt)

{"size": "120G"}.

setTmpfs(array $tmpfs)

{ "/run": "rw,noexec,nosuid,size=65536k" }.

setUTSMode(string $UTSMode)

No description

setUsernsMode(string $usernsMode)

No description

setShmSize(int $shmSize)

= 0.

setSysctls(array $sysctls)

{"net.ipv4.ip_forward": "1"}.

setRuntime(string $runtime)

No description

setConsoleSize(array $consoleSize)

item integer >= 0.

setIsolation(string $isolation)

"default" "process" "hyperv".

string
getContainerId()

No description

void
setContainerId(string $container_id)

No description

static string
checkFilter(string $type, array $filters)

No description

__construct($curl, $docker_host, $image)

Container constructor.

mixed
list(bool $all = false, int $limit = null, bool $size = false, array $filters = null)

No description

$this
setCreateJson(string|null $create_raw)

No description

string
getCreateJson()

No description

string|Client
create(bool $returnID = false, bool $pull_force = false)

No description

mixed
inspect(string|null $id, bool $size = false)

Inspect a container.

mixed
top(string|null $id, string $ps_args = '-ef')

List processes running inside a container.

mixed
logs(string $id, bool $follow = false, bool $stdout = true, bool $stderr = false, int $since = 0, int $until = 0, bool $timestamps = false, string $tail = 'all')

Get container logs.

mixed
changes(string|null $id)

Get changes on a container’s filesystem.

mixed
export(string $id)

Export a container.

mixed
stats(string|null $id, bool $stream = false)

Get container stats based on resource usage.

mixed
resize(string|null $id, int $height, int $width)

Resize a container TTY.

string
start(string|null $id, string $detachKeys = null)

No description

mixed
stop(string|null $id, int $waitTime = 0)

No description

mixed
restart(string|null $id, int $waitTime = 0)

No description

mixed
kill(string|null $id, string $signal = 'SIGKILL')

No description

mixed
update(string|null $id)

No description

mixed
rename(string|null $id, string $name)

No description

mixed
pause(string|null $id)

No description

mixed
unpause(string|null $id)

No description

mixed
attach(string|null $id, string $detachKeys = null, bool $logs = false, bool $stream = false, bool $stdin = false, bool $stdout = false, bool $stderr = false)

No description

mixed
attachViaWebSocket(string|null $id, string $detachKeys = null, bool $logs = false, bool $stream = false, bool $stdin = false, bool $stdout = false, bool $stderr = false)

Attach to a container via a websocket.

mixed
wait(string|null $id, string $condition = 'not - running')

Wait for a container.

mixed
remove(string|null $id, bool $v = false, bool $force = false, bool $link = false)

No description

mixed
getFileInfo(string|null $id, string $path)

Get information about files in a container.

mixed
archive(string|null $id, string $path)

Get an archive of a filesystem resource in a container.

mixed
extract(string|null $id, string $path, bool $noOverwriteDirNonDir, string $request)

Extract an archive of files or folders to a directory in a container.

mixed
prune(array $filters = [])

No description

mixed
createExec(string|null $id, array $cmd = null, array $env = null, string $user, string $workingDir, array $other)

No description

mixed
startExec(string|null $id, bool $detach = false, bool $tty = false)

No description

mixed
resizeExec(string|null $id, int $height, int $width)

No description

mixed
inspectExec(string $id)

No description

Details

at line 540
Client setCmd(array|null $cmd = null)

Parameters

array|null $cmd [ "nginx", "-g", "daemon off;"] null => 默认值,Dockerfile 中指定的值 [] => 默认值,Dockerfile 中指定的值 [""] => ""

Return Value

Client

at line 552
Client setImage(string $image)

Parameters

string $image

Return Value

Client

at line 564
Client setContainerName(string $container_name)

Parameters

string $container_name

Return Value

Client

at line 587
Client setNetworkingConfig(array $networkingConfig)

Parameters

array $networkingConfig

Return Value

Client

See also

https://docs.docker.com/engine/api/v1.37/#operation/ContainerCreate

at line 599
Client setHostname(string $hostname)

Parameters

string $hostname

Return Value

Client

at line 611
Client setDomainname(string $domainname)

Parameters

string $domainname

Return Value

Client

at line 623
Client setUser(string $user)

Parameters

string $user

Return Value

Client

at line 635
Client setAttachStdin(bool $attachStdin = false)

Parameters

bool $attachStdin

Return Value

Client

at line 647
Client setAttachStdout(bool $attachStdout = false)

Parameters

bool $attachStdout

Return Value

Client

at line 659
Client setAttachStderr(bool $attachStderr = false)

Parameters

bool $attachStderr

Return Value

Client

at line 673
Client setExposedPorts(array $exposedPorts)

Parameters

array $exposedPorts ["22/<tcp|udp|sctp>":{}]

Return Value

Client

at line 685
Client setTty(bool $tty = false)

Parameters

bool $tty

Return Value

Client

at line 697
Client setOpenStdin(bool $openStdin = false)

Parameters

bool $openStdin

Return Value

Client

at line 709
Client setStdinOnce(bool $stdinOnce = false)

Parameters

bool $stdinOnce

Return Value

Client

at line 723
Client setEnv(array|null $env)

Parameters

array|null $env ['env=value']

Return Value

Client

at line 742
Client setHealthcheck(array $test = [], int $interval = 0, int $timeout = 0, int $retries = 0, int $startPeriod = 0)

Parameters

array $test
int $interval
int $timeout
int $retries
int $startPeriod

Return Value

Client

at line 762
Client setArgsEscaped(bool $argsEscaped = false)

Command is already escaped (Windows only).

Parameters

bool $argsEscaped

Return Value

Client

at line 776
Client setVolumes(array $volumes)

Parameters

array $volumes [ "path" : {} ]

Return Value

Client

at line 788
Client setWorkingDir(string $workingDir)

Parameters

string $workingDir

Return Value

Client

at line 809
Client setEntrypoint(array|null $entrypoint = null)

Parameters

array|null $entrypoint ['/bin/sh', '-c'] 1. [] => [] 2. null => 默认值,Dockerfile 中指定的值 3. [""] => If the array consists of exactly one empty string ([""]) then the entry point is reset to system default (i.e., the entry point used by docker when there is no ENTRYPOINT instruction in the Dockerfile).

Return Value

Client

at line 823
Client setNetworkDisabled(bool $networkDisabled = true)

Disable networking for the container.

Parameters

bool $networkDisabled

Return Value

Client

at line 835
Client setMacAddress(string $macAddress)

Parameters

string $macAddress

Return Value

Client

at line 849
Client setOnBuild(array $onBuild)

Parameters

array $onBuild

Return Value

Client

at line 863
Client setLabels(array $labels = ['k' => 'v'])

Parameters

array $labels ['com.khs1994.docker' => 'value']

Return Value

Client

at line 875
Client setStopSignal(string $stopSignal = 'SIGTERM')

Parameters

string $stopSignal

Return Value

Client

at line 889
Client setStopTimeout(int $stopTimeout = 10)

Timeout to stop a container in seconds.

Parameters

int $stopTimeout

Return Value

Client

at line 903
Client setShell(array $shell)

Parameters

array $shell

Return Value

Client

at line 915
Client setCpuShares(int $cpuShares)

Parameters

int $cpuShares

Return Value

Client

at line 929
Client setMemory(int $memory = 0)

Memory limit in bytes.

Parameters

int $memory

Return Value

Client

at line 941
Client setCgroupParent(string $cgroupParent)

Parameters

string $cgroupParent

Return Value

Client

at line 955
Client setBlkioWeight(int $blkioWeight)

[ 0 .

. 1000 ].

Parameters

int $blkioWeight

Return Value

Client

at line 971
Client setBlkioWeightDevice(array $blkioWeightDevice)

$param array $blkioWeightDevice.

[{"Path": "device_path", "Weight": weight}].

Parameters

array $blkioWeightDevice

Return Value

Client

at line 985
Client setBlkioDeviceReadBps(array $blkioDeviceReadBps)

[{"Path": "device_path", "Rate": rate}].

Parameters

array $blkioDeviceReadBps

Return Value

Client

at line 999
Client setBlkioDeviceWriteBps(array $blkioDeviceWriteBps)

[{"Path": "device_path", "Rate": rate}].

Parameters

array $blkioDeviceWriteBps

Return Value

Client

at line 1013
Client setBlkioDeviceReadIOps(array $blkioDeviceReadIOps)

[{"Path": "device_path", "Rate": rate}].

Parameters

array $blkioDeviceReadIOps

Return Value

Client

at line 1027
Client setBlkioDeviceWriteIOps(array $blkioDeviceWriteIOps)

[{"Path": "device_path", "Rate": rate}].

Parameters

array $blkioDeviceWriteIOps

Return Value

Client

at line 1041
Client setCpuPeriod(int $cpuPeriod)

The length of a CPU period in microseconds.

Parameters

int $cpuPeriod

Return Value

Client

at line 1053
Client setCpuQuota(int $cpuQuota)

Parameters

int $cpuQuota

Return Value

Client

at line 1065
Client setCpuRealtimePeriod(int $cpuRealtimePeriod)

Parameters

int $cpuRealtimePeriod

Return Value

Client

at line 1077
Client setCpuRealtimeRuntime(int $cpuRealtimeRuntime)

Parameters

int $cpuRealtimeRuntime

Return Value

Client

at line 1091
Client setCpusetCpus(string $cpusetCpus)

Parameters

string $cpusetCpus CPUs in which to allow execution (e.g., 0-3, 0,1)

Return Value

Client

at line 1105
Client setCpusetMems(string $cpusetMems)

Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems.

Parameters

string $cpusetMems

Return Value

Client

at line 1117
Client setDevices(array $devices)

Parameters

array $devices

Return Value

Client

at line 1131
Client setDeviceCgroupRules(array $deviceCgroupRules)

Parameters

array $deviceCgroupRules

Return Value

Client

at line 1145
Client setKernelMemory(int $kernelMemory)

Kernel memory limit in bytes.

Parameters

int $kernelMemory

Return Value

Client

at line 1159
Client setMemoryReservation(int $memoryReservation)

Memory soft limit in bytes.

Parameters

int $memoryReservation

Return Value

Client

at line 1173
Client setMemorySwap(int $memorySwap)

Total memory limit (memory + swap). Set as -1 to enable unlimited swap.

Parameters

int $memorySwap

Return Value

Client

at line 1187
Client setMemorySwappiness(int $memorySwappiness)

[ 0 .

. 100 ].

Parameters

int $memorySwappiness

Return Value

Client

at line 1199
Client setNanoCPUs(int $nanoCPUs)

Parameters

int $nanoCPUs

Return Value

Client

at line 1211
Client setOomKillDisable(bool $oomKillDisable)

Parameters

bool $oomKillDisable

Return Value

Client

at line 1223
Client setInit(bool|null $init)

Parameters

bool|null $init

Return Value

Client

at line 1237
Client setPidsLimit(int|null $pidsLimit)

Tune a container's PIDs limit. Set 0 or -1 for unlimited, or null to not change.

Parameters

int|null $pidsLimit

Return Value

Client

at line 1251
Client setUlimits(array $ulimits)

{"Name": "nofile", "Soft": 1024, "Hard": 2048}.

Parameters

array $ulimits

Return Value

Client

at line 1265
Client setCpuCount(int $cpuCount)

The number of usable CPUs (Windows only).

Parameters

int $cpuCount

Return Value

Client

at line 1279
Client setCpuPercent(int $cpuPercent)

The usable percentage of the available CPUs (Windows only).

Parameters

int $cpuPercent

Return Value

Client

at line 1293
Client setIOMaximumIOps(int $IOMaximumIOps)

Maximum IOps for the container system drive (Windows only).

Parameters

int $IOMaximumIOps

Return Value

Client

at line 1307
Client setIOMaximumBandWidth(int $IOMaximumBandWidth)

Maximum IO in bytes per second for the container system drive (Windows only).

Parameters

int $IOMaximumBandWidth

Return Value

Client

at line 1328
Client setBinds(array $binds)

Parameters

array $binds [ "host-src:container-dest", "host-src:container-dest:ro", "volume-name:container-dest", "volume-name:container-dest:ro" ]

Return Value

Client

at line 1340
Client setContainerIDFile(string $containerIDFile)

Parameters

string $containerIDFile

Return Value

Client

at line 1352
Client setLogConfig(array $logConfig)

Parameters

array $logConfig

Return Value

Client

at line 1366
Client setNetworkMode(string $networkMode)

bridge, host, none, and container:<name|id>.

Parameters

string $networkMode

Return Value

Client

at line 1394
Client setPortBindings(array $portBindings)

Parameters

array $portBindings [ "80/tcp" => [ [ "HostIp" => "", "HostPort" => "80" ], ], "443/tcp" => [ [ "HostIp"=>"", "HostPort"=> "443" ], ], ]

Return Value

Client

at line 1412
Client setRestartPolicy(array $restartPolicy)

"" "always" "unless-stopped" "on-failure".

['Name' => '','MaximumRetryCount'=>'int']

MaximumRetryCount: If on-failure is used, the number of times to retry before giving up

Parameters

array $restartPolicy

Return Value

Client

at line 1427
Client setAutoRemove(bool $autoRemove)

Automatically remove the container when the container's process exits.

This has no effect if RestartPolicy is set.

Parameters

bool $autoRemove

Return Value

Client

at line 1441
Client setVolumeDriver(string $volumeDriver)

Driver that this container uses to mount volumes.

Parameters

string $volumeDriver

Return Value

Client

at line 1456
Client setVolumesFrom(array $volumesFrom)

A list of volumes to inherit from another container, specified in the form [:<ro|rw>].

Parameters

array $volumesFrom

Return Value

Client

at line 1483
Client setMounts(array $mounts)

Parameters

array $mounts
                     [
                     ["Type" => "bind",
                     "Source" => "/host_mnt/c",
                     "Destination" => "/container/path",
                     "Mode" => "",
                     "RW" => true,
                     "Propagation" => "rprivate"
                     ],
                     [
                     ]
                     ]
                     

Return Value

Client

at line 1495
Client setCapAdd(array $capAdd)

Parameters

array $capAdd

Return Value

Client

at line 1507
Client setCapDrop(array $capDrop)

Parameters

array $capDrop

Return Value

Client

at line 1521
Client setDns(array $dns)

Parameters

array $dns

Return Value

Client

at line 1535
Client setDnsOptions(array $dnsOptions)

Parameters

array $dnsOptions

Return Value

Client

at line 1549
Client setDnsSearch(array $dnsSearch)

Parameters

array $dnsSearch

Return Value

Client

at line 1563
Client setExtraHosts(array $extraHosts)

Parameters

array $extraHosts ["hostname:IP"]

Return Value

Client

at line 1577
Client setGroupAdd(array $groupAdd)

Parameters

array $groupAdd

Return Value

Client

at line 1589
Client setIpcMode(string $ipcMode)

Parameters

string $ipcMode

Return Value

Client

at line 1603
Client setCgroup(string $Cgroup)

Cgroup to use for the container.

Parameters

string $Cgroup

Return Value

Client

at line 1615
Client setOomScoreAdj(int $oomScoreAdj)

Parameters

int $oomScoreAdj

Return Value

Client

at line 1629
Client setPidMode(string $pidMode)

"container:<name|id>" | "host".

Parameters

string $pidMode

Return Value

Client

at line 1641
Client setPrivileged(bool $privileged)

Parameters

bool $privileged

Return Value

Client

at line 1653
Client setPublishAllPorts(bool $publishAllPorts)

Parameters

bool $publishAllPorts

Return Value

Client

at line 1665
Client setReadonlyRootfs(bool $readonlyRootfs)

Parameters

bool $readonlyRootfs

Return Value

Client

at line 1679
Client setSecurityOpt(array $securityOpt)

Parameters

array $securityOpt

Return Value

Client

at line 1693
Client setStorageOpt(array $storageOpt)

{"size": "120G"}.

Parameters

array $storageOpt

Return Value

Client

at line 1707
Client setTmpfs(array $tmpfs)

{ "/run": "rw,noexec,nosuid,size=65536k" }.

Parameters

array $tmpfs

Return Value

Client

at line 1719
Client setUTSMode(string $UTSMode)

Parameters

string $UTSMode

Return Value

Client

at line 1731
Client setUsernsMode(string $usernsMode)

Parameters

string $usernsMode

Return Value

Client

at line 1745
Client setShmSize(int $shmSize)

= 0.

Parameters

int $shmSize

Return Value

Client

at line 1759
Client setSysctls(array $sysctls)

{"net.ipv4.ip_forward": "1"}.

Parameters

array $sysctls

Return Value

Client

at line 1771
Client setRuntime(string $runtime)

Parameters

string $runtime

Return Value

Client

at line 1787
Client setConsoleSize(array $consoleSize)

item integer >= 0.

Initial console size, as an [height, width] array. (Windows only)

Parameters

array $consoleSize

Return Value

Client

at line 1803
Client setIsolation(string $isolation)

"default" "process" "hyperv".

Isolation technology of the container. (Windows only)

Parameters

string $isolation

Return Value

Client

at line 1812
string getContainerId()

Return Value

string

at line 1817
void setContainerId(string $container_id)

Parameters

string $container_id

Return Value

void

at line 1827
static string checkFilter(string $type, array $filters)

Parameters

string $type
array $filters

Return Value

string

Exceptions

Exception

at line 1864
__construct($curl, $docker_host, $image)

Container constructor.

Parameters

$curl
$docker_host
$image

Exceptions

Exception

at line 1894
mixed list(bool $all = false, int $limit = null, bool $size = false, array $filters = null)

Parameters

bool $all
int $limit
bool $size
array $filters

Return Value

mixed 200

Exceptions

Exception

at line 1914
$this setCreateJson(string|null $create_raw)

Parameters

string|null $create_raw

Return Value

$this

Exceptions

Exception

at line 1963
string getCreateJson()

Return Value

string

at line 1977
string|Client create(bool $returnID = false, bool $pull_force = false)

Parameters

bool $returnID
bool $pull_force

Return Value

string|Client 201

Exceptions

Exception

at line 2014
mixed inspect(string|null $id, bool $size = false)

Inspect a container.

Return low-level information about a container.

Parameters

string|null $id
bool $size

Return Value

mixed 200

Exceptions

Exception

at line 2030
mixed top(string|null $id, string $ps_args = '-ef')

List processes running inside a container.

On Unix systems, this is done by running the ps command. This endpoint is not supported on Windows.

Parameters

string|null $id
string $ps_args

Return Value

mixed 200

Exceptions

Exception

at line 2050
mixed logs(string $id, bool $follow = false, bool $stdout = true, bool $stderr = false, int $since = 0, int $until = 0, bool $timestamps = false, string $tail = 'all')

Get container logs.

Get stdout and stderr logs from a container.

Note: This endpoint works only for containers with the json-file or journald logging driver.

Parameters

string $id
bool $follow
bool $stdout
bool $stderr
int $since
int $until
bool $timestamps
string $tail

Return Value

mixed 101 200

Exceptions

Exception

at line 2080
mixed changes(string|null $id)

Get changes on a container’s filesystem.

Returns which files in a container's filesystem have been added, deleted, or modified. The Kind of modification can be one of:

0: Modified 1: Added 2: Deleted

Parameters

string|null $id

Return Value

mixed 200

Exceptions

Exception

at line 2098
mixed export(string $id)

Export a container.

Export the contents of a container as a tarball.

Parameters

string $id

Return Value

mixed 200

Exceptions

Exception

at line 2115
mixed stats(string|null $id, bool $stream = false)

Get container stats based on resource usage.

Parameters

string|null $id
bool $stream

Return Value

mixed 200

Exceptions

Exception

at line 2134
mixed resize(string|null $id, int $height, int $width)

Resize a container TTY.

Resize the TTY for a container. You must restart the container for the resize to take effect.

Parameters

string|null $id
int $height
int $width

Return Value

mixed 200

Exceptions

Exception

at line 2153
string start(string|null $id, string $detachKeys = null)

Parameters

string|null $id ID or name of the container
string $detachKeys override the key sequence for detaching a container. Format is a single character [a-Z] or ctrl-<value> where is one of: a-z,@,^,[,, or _

Return Value

string 204 304

Exceptions

Exception

at line 2173
mixed stop(string|null $id, int $waitTime = 0)

Parameters

string|null $id
int $waitTime

Return Value

mixed 204 304

Exceptions

Exception

at line 2195
mixed restart(string|null $id, int $waitTime = 0)

Parameters

string|null $id
int $waitTime

Return Value

mixed 204

Exceptions

Exception

at line 2217
mixed kill(string|null $id, string $signal = 'SIGKILL')

Parameters

string|null $id
string $signal

Return Value

mixed 204

Exceptions

Exception

at line 2241
mixed update(string|null $id)

Parameters

string|null $id

Return Value

mixed 200

Exceptions

Exception

See also

https://docs.docker.com/engine/api/v1.37/#operation/ContainerUpdate

at line 2255
mixed rename(string|null $id, string $name)

Parameters

string|null $id
string $name

Return Value

mixed 204

Exceptions

Exception

at line 2277
mixed pause(string|null $id)

Parameters

string|null $id

Return Value

mixed 204

Exceptions

Exception

at line 2299
mixed unpause(string|null $id)

Parameters

string|null $id

Return Value

mixed 204

Exceptions

Exception

at line 2323
mixed attach(string|null $id, string $detachKeys = null, bool $logs = false, bool $stream = false, bool $stdin = false, bool $stdout = false, bool $stderr = false)

Parameters

string|null $id
string $detachKeys
bool $logs
bool $stream
bool $stdin
bool $stdout
bool $stderr

Return Value

mixed 101 200

Exceptions

Exception

See also

https://docs.docker.com/engine/api/v1.37/#operation/ContainerAttach

at line 2351
mixed attachViaWebSocket(string|null $id, string $detachKeys = null, bool $logs = false, bool $stream = false, bool $stdin = false, bool $stdout = false, bool $stderr = false)

Attach to a container via a websocket.

Parameters

string|null $id
string $detachKeys
bool $logs
bool $stream
bool $stdin
bool $stdout
bool $stderr

Return Value

mixed 101 200

Exceptions

Exception

See also

https://docs.docker.com/engine/api/v1.37/#operation/ContainerAttachWebsocket

at line 2377
mixed wait(string|null $id, string $condition = 'not - running')

Wait for a container.

Block until a container stops, then returns the exit code.

Parameters

string|null $id
string $condition

Return Value

mixed 200

Exceptions

Exception

at line 2389
mixed remove(string|null $id, bool $v = false, bool $force = false, bool $link = false)

Parameters

string|null $id
bool $v
bool $force
bool $link

Return Value

mixed 204

Exceptions

Exception

at line 2418
mixed getFileInfo(string|null $id, string $path)

Get information about files in a container.

A response header X-Docker-Container-Path-Stat is return containing a base64 - encoded JSON object with some filesystem header information about the path.

Parameters

string|null $id
string $path

Return Value

mixed 200

Exceptions

Exception

at line 2438
mixed archive(string|null $id, string $path)

Get an archive of a filesystem resource in a container.

Parameters

string|null $id
string $path

Return Value

mixed 200

Exceptions

Exception

at line 2458
mixed extract(string|null $id, string $path, bool $noOverwriteDirNonDir, string $request)

Extract an archive of files or folders to a directory in a container.

Parameters

string|null $id
string $path
bool $noOverwriteDirNonDir
string $request

Return Value

mixed 200

Exceptions

Exception

at line 2493
mixed prune(array $filters = [])

Parameters

array $filters Available filters:

until=<timestamp> Prune containers created before this timestamp. The can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. 10m, 1h30m) computed relative to the daemon machine’s time.

label (label=, label==, label!=, or label!==) Prune containers with (or without, in case label!=... is used) the specified labels.

Return Value

mixed 200

Exceptions

Exception

at line 2507
mixed createExec(string|null $id, array $cmd = null, array $env = null, string $user, string $workingDir, array $other)

Parameters

string|null $id
array $cmd
array $env
string $user
string $workingDir
array $other

Return Value

mixed

Exceptions

Exception

at line 2533
mixed startExec(string|null $id, bool $detach = false, bool $tty = false)

Parameters

string|null $id
bool $detach
bool $tty

Return Value

mixed

Exceptions

Exception

at line 2552
mixed resizeExec(string|null $id, int $height, int $width)

Parameters

string|null $id
int $height
int $width

Return Value

mixed

Exceptions

Exception

at line 2569
mixed inspectExec(string $id)

Parameters

string $id

Return Value

mixed

Exceptions

Exception