File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,8 @@ class GenericContainer implements TestContainer
4747 /** @var list<string> */
4848 protected array $ command = [];
4949
50+ protected bool $ autoRemove = false ;
51+
5052 protected ?string $ entryPoint = null ;
5153
5254 protected ?HealthConfig $ healthConfig = null ;
@@ -120,6 +122,13 @@ public function withCommand(array $command): static
120122 return $ this ;
121123 }
122124
125+ public function withAutoRemove (bool $ autoRemove ): static
126+ {
127+ $ this ->autoRemove = $ autoRemove ;
128+
129+ return $ this ;
130+ }
131+
123132 /**
124133 * @param array<array{source: string, target: string, mode?: int}> $files
125134 */
@@ -455,6 +464,8 @@ protected function createHostConfig(): ?HostConfig
455464
456465 $ hostConfig = new HostConfig ();
457466
467+ $ hostConfig ->setAutoRemove ($ this ->autoRemove );
468+
458469 if ($ this ->exposedPorts !== []) {
459470 $ portBindings = $ this ->createPortBindings ();
460471 $ hostConfig ->setPortBindings ($ portBindings );
You can’t perform that action at this time.
0 commit comments