Merge pull request #10 from dinamic/feature/custom-entrypoint

Ability to specify a container entry point
This commit is contained in:
Shyim
2024-07-13 10:34:31 +09:00
committed by GitHub
+14
View File
@@ -17,6 +17,8 @@ class Container
{
private string $id;
private ?string $entryPoint = null;
/**
* @var array<string, string>
*/
@@ -54,6 +56,13 @@ class Container
return new Container($image);
}
public function withEntryPoint(string $entryPoint): self
{
$this->entryPoint = $entryPoint;
return $this;
}
public function withEnvironment(string $name, string $value): self
{
$this->env[$name] = $value;
@@ -138,6 +147,11 @@ class Container
$params[] = $this->network;
}
if ($this->entryPoint !== null) {
$params[] = '--entrypoint';
$params[] = $this->entryPoint;
}
$params[] = $this->image;
$this->process = new Process($params);