Skip to content

Commit b97d34d

Browse files
golorodenclaude
andcommitted
fix: Remove duplicate withCommand() call in Container.php
The previous implementation called withCommand() twice: - Once when creating the container - Again after adding signing key parameters This caused issues in CI environments. The fix builds the complete command array first, then calls withCommand() only once at the end. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 5b2dcd8 commit b97d34d

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/Container.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ public function start(): void
5959
];
6060

6161
$container = (new GenericContainer("{$this->imageName}:{$this->imageTag}"))
62-
->withExposedPorts($this->internalPort)
63-
->withCommand($command);
62+
->withExposedPorts($this->internalPort);
6463

6564
if ($this->signingKey instanceof SigningKey) {
6665
// Create a temporary file with the signing key
@@ -70,15 +69,17 @@ public function start(): void
7069
}
7170
file_put_contents($tempFile, $this->signingKey->privateKeyPem);
7271

73-
// Mount the temp file into the container
72+
// Add signing key parameters to command
7473
$command[] = '--signing-key-file';
7574
$command[] = '/tmp/signing-key.pem';
76-
$container = $container
77-
->withCommand($command)
78-
->withMount($tempFile, '/tmp/signing-key.pem');
75+
76+
// Mount the temp file into the container
77+
$container = $container->withMount($tempFile, '/tmp/signing-key.pem');
7978
}
8079

81-
$container = $container->withWait((new WaitForHttp($this->internalPort, 20000))->withPath('/api/v1/ping'));
80+
$container = $container
81+
->withCommand($command)
82+
->withWait((new WaitForHttp($this->internalPort, 20000))->withPath('/api/v1/ping'));
8283

8384
try {
8485
$this->container = $container->start();

0 commit comments

Comments
 (0)