Client
class Client
Container.
Constants
TYPE |
|
Properties
array | $ExposedPorts |
Methods
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Command is already escaped (Windows only).
No description
No description
No description
Disable networking for the container.
No description
No description
Timeout to stop a container in seconds.
No description
No description
[ 0 .
$param array
[{"Path": "device_path", "Rate": rate}].
[{"Path": "device_path", "Rate": rate}].
[{"Path": "device_path", "Rate": rate}].
[{"Path": "device_path", "Rate": rate}].
The length of a CPU period in microseconds.
No description
No description
No description
No description
Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems.
No description
No description
Kernel memory limit in bytes.
Memory soft limit in bytes.
Total memory limit (memory + swap). Set as -1 to enable unlimited swap.
[ 0 .
No description
No description
Tune a container's PIDs limit. Set 0 or -1 for unlimited, or null to not change.
{"Name": "nofile", "Soft": 1024, "Hard": 2048}.
The number of usable CPUs (Windows only).
The usable percentage of the available CPUs (Windows only).
Maximum IOps for the container system drive (Windows only).
Maximum IO in bytes per second for the container system drive (Windows only).
No description
No description
bridge, host, none, and container:<name|id>.
No description
"" "always" "unless-stopped" "on-failure".
Automatically remove the container when the container's process exits.
Driver that this container uses to mount volumes.
A list of volumes to inherit from another container,
specified in the form
No description
No description
No description
No description
No description
No description
No description
"container:<name|id>" | "host".
No description
No description
No description
No description
{"size": "120G"}.
No description
No description
= 0.
{"net.ipv4.ip_forward": "1"}.
No description
item integer >= 0.
"default" "process" "hyperv".
No description
No description
No description
Container constructor.
No description
No description
No description
Inspect a container.
List processes running inside a container.
Get container logs.
Get changes on a container’s filesystem.
Export a container.
Get container stats based on resource usage.
Resize a container TTY.
No description
No description
No description
No description
No description
No description
No description
No description
No description
Attach to a container via a websocket.
Wait for a container.
No description
Get information about files in a container.
Get an archive of a filesystem resource in a container.
Extract an archive of files or folders to a directory in a container.
No description
No description
No description
No description
No description
Details
at line 540
Client
setCmd(array|null $cmd = null)
at line 552
Client
setImage(string $image)
at line 564
Client
setContainerName(string $container_name)
at line 587
Client
setNetworkingConfig(array $networkingConfig)
at line 599
Client
setHostname(string $hostname)
at line 611
Client
setDomainname(string $domainname)
at line 623
Client
setUser(string $user)
at line 635
Client
setAttachStdin(bool $attachStdin = false)
at line 647
Client
setAttachStdout(bool $attachStdout = false)
at line 659
Client
setAttachStderr(bool $attachStderr = false)
at line 673
Client
setExposedPorts(array $exposedPorts)
at line 685
Client
setTty(bool $tty = false)
at line 697
Client
setOpenStdin(bool $openStdin = false)
at line 709
Client
setStdinOnce(bool $stdinOnce = false)
at line 723
Client
setEnv(array|null $env)
at line 742
Client
setHealthcheck(array $test = [], int $interval = 0, int $timeout = 0, int $retries = 0, int $startPeriod = 0)
at line 762
Client
setArgsEscaped(bool $argsEscaped = false)
Command is already escaped (Windows only).
at line 776
Client
setVolumes(array $volumes)
at line 788
Client
setWorkingDir(string $workingDir)
at line 809
Client
setEntrypoint(array|null $entrypoint = null)
at line 823
Client
setNetworkDisabled(bool $networkDisabled = true)
Disable networking for the container.
at line 835
Client
setMacAddress(string $macAddress)
at line 849
Client
setOnBuild(array $onBuild)
at line 863
Client
setLabels(array $labels = ['k' => 'v'])
at line 875
Client
setStopSignal(string $stopSignal = 'SIGTERM')
at line 889
Client
setStopTimeout(int $stopTimeout = 10)
Timeout to stop a container in seconds.
at line 903
Client
setShell(array $shell)
at line 915
Client
setCpuShares(int $cpuShares)
at line 929
Client
setMemory(int $memory = 0)
Memory limit in bytes.
at line 941
Client
setCgroupParent(string $cgroupParent)
at line 955
Client
setBlkioWeight(int $blkioWeight)
[ 0 .
. 1000 ].
at line 971
Client
setBlkioWeightDevice(array $blkioWeightDevice)
$param array
[{"Path": "device_path", "Weight": weight}].
at line 985
Client
setBlkioDeviceReadBps(array $blkioDeviceReadBps)
[{"Path": "device_path", "Rate": rate}].
at line 999
Client
setBlkioDeviceWriteBps(array $blkioDeviceWriteBps)
[{"Path": "device_path", "Rate": rate}].
at line 1013
Client
setBlkioDeviceReadIOps(array $blkioDeviceReadIOps)
[{"Path": "device_path", "Rate": rate}].
at line 1027
Client
setBlkioDeviceWriteIOps(array $blkioDeviceWriteIOps)
[{"Path": "device_path", "Rate": rate}].
at line 1041
Client
setCpuPeriod(int $cpuPeriod)
The length of a CPU period in microseconds.
at line 1053
Client
setCpuQuota(int $cpuQuota)
at line 1065
Client
setCpuRealtimePeriod(int $cpuRealtimePeriod)
at line 1077
Client
setCpuRealtimeRuntime(int $cpuRealtimeRuntime)
at line 1091
Client
setCpusetCpus(string $cpusetCpus)
at line 1105
Client
setCpusetMems(string $cpusetMems)
Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems.
at line 1117
Client
setDevices(array $devices)
at line 1131
Client
setDeviceCgroupRules(array $deviceCgroupRules)
at line 1145
Client
setKernelMemory(int $kernelMemory)
Kernel memory limit in bytes.
at line 1159
Client
setMemoryReservation(int $memoryReservation)
Memory soft limit in bytes.
at line 1173
Client
setMemorySwap(int $memorySwap)
Total memory limit (memory + swap). Set as -1 to enable unlimited swap.
at line 1187
Client
setMemorySwappiness(int $memorySwappiness)
[ 0 .
. 100 ].
at line 1199
Client
setNanoCPUs(int $nanoCPUs)
at line 1211
Client
setOomKillDisable(bool $oomKillDisable)
at line 1223
Client
setInit(bool|null $init)
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.
at line 1251
Client
setUlimits(array $ulimits)
{"Name": "nofile", "Soft": 1024, "Hard": 2048}.
at line 1265
Client
setCpuCount(int $cpuCount)
The number of usable CPUs (Windows only).
at line 1279
Client
setCpuPercent(int $cpuPercent)
The usable percentage of the available CPUs (Windows only).
at line 1293
Client
setIOMaximumIOps(int $IOMaximumIOps)
Maximum IOps for the container system drive (Windows only).
at line 1307
Client
setIOMaximumBandWidth(int $IOMaximumBandWidth)
Maximum IO in bytes per second for the container system drive (Windows only).
at line 1328
Client
setBinds(array $binds)
at line 1340
Client
setContainerIDFile(string $containerIDFile)
at line 1352
Client
setLogConfig(array $logConfig)
at line 1366
Client
setNetworkMode(string $networkMode)
bridge, host, none, and container:<name|id>.
at line 1394
Client
setPortBindings(array $portBindings)
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
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.
at line 1441
Client
setVolumeDriver(string $volumeDriver)
Driver that this container uses to mount volumes.
at line 1456
Client
setVolumesFrom(array $volumesFrom)
A list of volumes to inherit from another container,
specified in the form
at line 1483
Client
setMounts(array $mounts)
at line 1495
Client
setCapAdd(array $capAdd)
at line 1507
Client
setCapDrop(array $capDrop)
at line 1521
Client
setDns(array $dns)
at line 1535
Client
setDnsOptions(array $dnsOptions)
at line 1549
Client
setDnsSearch(array $dnsSearch)
at line 1563
Client
setExtraHosts(array $extraHosts)
at line 1577
Client
setGroupAdd(array $groupAdd)
at line 1589
Client
setIpcMode(string $ipcMode)
at line 1603
Client
setCgroup(string $Cgroup)
Cgroup to use for the container.
at line 1615
Client
setOomScoreAdj(int $oomScoreAdj)
at line 1629
Client
setPidMode(string $pidMode)
"container:<name|id>" | "host".
at line 1641
Client
setPrivileged(bool $privileged)
at line 1653
Client
setPublishAllPorts(bool $publishAllPorts)
at line 1665
Client
setReadonlyRootfs(bool $readonlyRootfs)
at line 1679
Client
setSecurityOpt(array $securityOpt)
at line 1693
Client
setStorageOpt(array $storageOpt)
{"size": "120G"}.
at line 1707
Client
setTmpfs(array $tmpfs)
{ "/run": "rw,noexec,nosuid,size=65536k" }.
at line 1719
Client
setUTSMode(string $UTSMode)
at line 1731
Client
setUsernsMode(string $usernsMode)
at line 1745
Client
setShmSize(int $shmSize)
= 0.
at line 1759
Client
setSysctls(array $sysctls)
{"net.ipv4.ip_forward": "1"}.
at line 1771
Client
setRuntime(string $runtime)
at line 1787
Client
setConsoleSize(array $consoleSize)
item integer >= 0.
Initial console size, as an [height, width] array. (Windows only)
at line 1803
Client
setIsolation(string $isolation)
"default" "process" "hyperv".
Isolation technology of the container. (Windows only)
at line 1812
string
getContainerId()
at line 1817
void
setContainerId(string $container_id)
at line 1827
static string
checkFilter(string $type, array $filters)
at line 1864
__construct($curl, $docker_host, $image)
Container constructor.
at line 1894
mixed
list(bool $all = false, int $limit = null, bool $size = false, array $filters = null)
at line 1914
$this
setCreateJson(string|null $create_raw)
at line 1963
string
getCreateJson()
at line 1977
string|Client
create(bool $returnID = false, bool $pull_force = false)
at line 2014
mixed
inspect(string|null $id, bool $size = false)
Inspect a container.
Return low-level information about a container.
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.
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.
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
at line 2098
mixed
export(string $id)
Export a container.
Export the contents of a container as a tarball.
at line 2115
mixed
stats(string|null $id, bool $stream = false)
Get container stats based on resource usage.
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.
at line 2153
string
start(string|null $id, string $detachKeys = null)
at line 2173
mixed
stop(string|null $id, int $waitTime = 0)
at line 2195
mixed
restart(string|null $id, int $waitTime = 0)
at line 2217
mixed
kill(string|null $id, string $signal = 'SIGKILL')
at line 2241
mixed
update(string|null $id)
at line 2255
mixed
rename(string|null $id, string $name)
at line 2277
mixed
pause(string|null $id)
at line 2299
mixed
unpause(string|null $id)
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)
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.
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.
at line 2389
mixed
remove(string|null $id, bool $v = false, bool $force = false, bool $link = false)
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.
at line 2438
mixed
archive(string|null $id, string $path)
Get an archive of a filesystem resource in a container.
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.