Skip to content

Commit

Permalink
Merge pull request #11 from dinamic/feature/with-privileged
Browse files Browse the repository at this point in the history
  • Loading branch information
shyim authored Jul 16, 2024
2 parents 3ddc75e + 913c88e commit 137d073
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Container/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class Container
private Process $process;
private WaitInterface $wait;

private bool $privileged = false;
private ?string $network = null;
private ?string $healthCheckCommand = null;
private int $healthCheckIntervalInMS;
Expand Down Expand Up @@ -108,6 +109,13 @@ public function withPort(string $localPort, string $containerPort): self
return $this;
}

public function withPrivileged(bool $privileged = true): self
{
$this->privileged = $privileged;

return $this;
}

public function withNetwork(string $network): self
{
$this->network = $network;
Expand Down Expand Up @@ -152,6 +160,10 @@ public function run(bool $wait = true): self
$params[] = $this->entryPoint;
}

if ($this->privileged) {
$params[] = '--privileged';
}

$params[] = $this->image;

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

0 comments on commit 137d073

Please sign in to comment.