mirror of
https://github.com/stan220/testcontainers-php.git
synced 2026-09-08 17:29:29 +00:00
Merge pull request #11 from dinamic/feature/with-privileged
This commit is contained in:
@@ -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;
|
||||
@@ -108,6 +109,13 @@ class Container
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function withPrivileged(bool $privileged = true): self
|
||||
{
|
||||
$this->privileged = $privileged;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function withNetwork(string $network): self
|
||||
{
|
||||
$this->network = $network;
|
||||
@@ -152,6 +160,10 @@ class Container
|
||||
$params[] = $this->entryPoint;
|
||||
}
|
||||
|
||||
if ($this->privileged) {
|
||||
$params[] = '--privileged';
|
||||
}
|
||||
|
||||
$params[] = $this->image;
|
||||
|
||||
$this->process = new Process($params);
|
||||
|
||||
Reference in New Issue
Block a user