Merge pull request #11 from dinamic/feature/with-privileged

This commit is contained in:
Shyim
2024-07-16 19:10:39 +09:00
committed by GitHub
+12
View File
@@ -27,6 +27,7 @@ class Container
private Process $process; private Process $process;
private WaitInterface $wait; private WaitInterface $wait;
private bool $privileged = false;
private ?string $network = null; private ?string $network = null;
private ?string $healthCheckCommand = null; private ?string $healthCheckCommand = null;
private int $healthCheckIntervalInMS; private int $healthCheckIntervalInMS;
@@ -108,6 +109,13 @@ class Container
return $this; return $this;
} }
public function withPrivileged(bool $privileged = true): self
{
$this->privileged = $privileged;
return $this;
}
public function withNetwork(string $network): self public function withNetwork(string $network): self
{ {
$this->network = $network; $this->network = $network;
@@ -152,6 +160,10 @@ class Container
$params[] = $this->entryPoint; $params[] = $this->entryPoint;
} }
if ($this->privileged) {
$params[] = '--privileged';
}
$params[] = $this->image; $params[] = $this->image;
$this->process = new Process($params); $this->process = new Process($params);