This repository was archived by the owner on Oct 26, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 266
Expand file tree
/
Copy pathDocker.php
More file actions
99 lines (85 loc) · 3.09 KB
/
Copy pathDocker.php
File metadata and controls
99 lines (85 loc) · 3.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?php
declare(strict_types=1);
namespace Docker;
use Docker\API\Client;
use Docker\API\Model\AuthConfig;
use Docker\Endpoint\ContainerAttach;
use Docker\Endpoint\ContainerAttachWebsocket;
use Docker\Endpoint\ContainerLogs;
use Docker\Endpoint\ExecStart;
use Docker\Endpoint\ImageBuild;
use Docker\Endpoint\ImageCreate;
use Docker\Endpoint\ImagePush;
use Docker\Endpoint\SystemEvents;
/**
* Docker\Docker.
*/
class Docker extends Client
{
/**
* {@inheritdoc}
*/
public function containerAttach(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
{
return $this->executePsr7Endpoint(new ContainerAttach($id, $queryParameters), $fetch);
}
/**
* {@inheritdoc}
*/
public function containerAttachWebsocket(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
{
return $this->executePsr7Endpoint(new ContainerAttachWebsocket($id, $queryParameters), $fetch);
}
/**
* {@inheritdoc}
*/
public function containerLogs(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
{
return $this->executePsr7Endpoint(new ContainerLogs($id, $queryParameters), $fetch);
}
/**
* {@inheritdoc}
*/
public function execStart(string $id, \Docker\API\Model\ExecIdStartPostBody $execStartConfig, string $fetch = self::FETCH_OBJECT)
{
return $this->executePsr7Endpoint(new ExecStart($id, $execStartConfig), $fetch);
}
/**
* {@inheritdoc}
*/
public function imageBuild($inputStream, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT)
{
return $this->executePsr7Endpoint(new ImageBuild($inputStream, $queryParameters, $headerParameters), $fetch);
}
/**
* {@inheritdoc}
*/
public function imageCreate(string $inputImage, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT)
{
return $this->executePsr7Endpoint(new ImageCreate($inputImage, $queryParameters, $headerParameters), $fetch);
}
/**
* {@inheritdoc}
*/
public function imagePush(string $name, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT)
{
if (isset($headerParameters['X-Registry-Auth']) && $headerParameters['X-Registry-Auth'] instanceof AuthConfig) {
$headerParameters['X-Registry-Auth'] = \base64_encode($this->serializer->serialize($headerParameters['X-Registry-Auth'], 'json'));
}
return $this->executePsr7Endpoint(new ImagePush($name, $queryParameters, $headerParameters), $fetch);
}
/**
* {@inheritdoc}
*/
public function systemEvents(array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
{
return $this->executePsr7Endpoint(new SystemEvents($queryParameters), $fetch);
}
public static function create($httpClient = null)
{
if (null === $httpClient) {
$httpClient = DockerClientFactory::createFromEnv();
}
return parent::create($httpClient);
}
}