-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.php
202 lines (168 loc) · 2.92 KB
/
Dockerfile.php
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
<?php namespace Rancherize\Blueprint\Infrastructure\Dockerfile;
/**
* Class Dockerfile
* @package Rancherize\Blueprint\Infrastructure
*
* Data object representing a dockerfile to be written to disk later
*/
class Dockerfile {
/**
* @var string
*/
protected $from = '';
/**
* @var string
*/
protected $command = '';
/**
* @var string
*/
protected $workdir = '';
/**
* @var string
*/
protected $entrypoint = '';
/**
* @var string[]
*/
protected $inlineFiles = [];
/**
* @var string[]
*/
protected $volumes = [];
/**
* @var string[]
*/
protected $copies = [];
/**
* @var string[]
*/
protected $runCommands = [];
/**
* @var string
*/
protected $user = '';
/**
* @var string
*/
protected $group = '';
/**
* @param string $from
*/
public function setFrom(string $from) {
$this->from = $from;
}
/**
* @return string
*/
public function getFrom(): string {
return $this->from;
}
/**
* @return string
*/
public function getCommand(): string {
return $this->command;
}
/**
* @param string $command
*/
public function setCommand(string $command) {
$this->command = $command;
}
/**
* @return string
*/
public function getWorkdir(): string {
return $this->workdir;
}
/**
* @param string $workdir
*/
public function setWorkdir(string $workdir) {
$this->workdir = $workdir;
}
/**
* @return string
*/
public function getEntrypoint(): string {
return $this->entrypoint;
}
/**
* @param string $entrypoint
*/
public function setEntrypoint(string $entrypoint) {
$this->entrypoint = $entrypoint;
}
/**
* @return \string[]
*/
public function getVolumes(): array {
return $this->volumes;
}
/**
* @param string $volume
*/
public function addVolume(string $volume) {
// [$volume] from having the same volume set multiple times
$this->volumes[$volume] = $volume;
}
/**
* @return array
*/
public function getCopies(): array {
return $this->copies;
}
/**
* @param string $from
* @param string $target
*/
public function copy(string $from, string $target) {
$this->copies[$from] = $target;
}
/**
* @return \string[]
*/
public function getRunCommands(): array {
return $this->runCommands;
}
/**
* @param $command
*/
public function run($command) {
$this->runCommands[$command] = $command;
}
/**
* @return string
*/
public function getUser(): string {
return $this->user;
}
/**
* @param string $user
*/
public function setUser( string $user ) {
$this->user = $user;
}
/**
* @return string
*/
public function getGroup(): string {
return $this->group;
}
/**
* @param string $group
*/
public function setGroup( string $group ) {
$this->group = $group;
}
public function addInlineFile($path, $content) {
$this->inlineFiles[$path] = $content;
}
/**
* @return string[]
*/
public function getInlineFiles(): array {
return $this->inlineFiles;
}
}