Skip to content

Commit 137d073

Browse files
authored
Merge pull request #11 from dinamic/feature/with-privileged
2 parents 3ddc75e + 913c88e commit 137d073

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Container/Container.php

+12
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class Container
2727
private Process $process;
2828
private WaitInterface $wait;
2929

30+
private bool $privileged = false;
3031
private ?string $network = null;
3132
private ?string $healthCheckCommand = null;
3233
private int $healthCheckIntervalInMS;
@@ -108,6 +109,13 @@ public function withPort(string $localPort, string $containerPort): self
108109
return $this;
109110
}
110111

112+
public function withPrivileged(bool $privileged = true): self
113+
{
114+
$this->privileged = $privileged;
115+
116+
return $this;
117+
}
118+
111119
public function withNetwork(string $network): self
112120
{
113121
$this->network = $network;
@@ -152,6 +160,10 @@ public function run(bool $wait = true): self
152160
$params[] = $this->entryPoint;
153161
}
154162

163+
if ($this->privileged) {
164+
$params[] = '--privileged';
165+
}
166+
155167
$params[] = $this->image;
156168

157169
$this->process = new Process($params);

0 commit comments

Comments
 (0)