This commit is contained in:
Sergei Shitikov
2024-09-06 21:30:46 +02:00
parent 656f38f056
commit abe8159bcb
3 changed files with 8 additions and 13 deletions
@@ -110,12 +110,16 @@ class StartedGenericContainer implements StartedTestContainer
//TODO: not ready yet //TODO: not ready yet
public function getFirstMappedPort(): int public function getFirstMappedPort(): int
{ {
var_dump($this->dockerClient);die(123);
/** @var \Docker\API\Model\ContainersIdJsonGetResponse200 | null $containerInspectResponse */
$containerInspectResponse = $this->dockerClient->containerInspect($this->id); $containerInspectResponse = $this->dockerClient->containerInspect($this->id);
$settings = $containerInspectResponse->getNetworkSettings(); $settings = $containerInspectResponse->getNetworkSettings();
$ports = (array)$settings->getPorts(); $ports = (array)$settings->getPorts();
$port = array_key_first($ports); $port = array_key_first($ports);
var_dump($ports, $port, (int)$ports[$port][0]->getHostPort());
return (int) $ports[$port][0]->getHostPort(); return (int) $ports[$port][0]->getHostPort();
} }
-9
View File
@@ -22,15 +22,6 @@ class OpenSearchContainer extends GenericContainer
)); ));
} }
/**
* @deprecated Use constructor instead
* Left for backward compatibility
*/
public static function make(string $version = 'latest'): self
{
return new self($version);
}
public function withDisabledSecurityPlugin(): self public function withDisabledSecurityPlugin(): self
{ {
$this->withEnvironment('plugins.security.disabled', 'true'); $this->withEnvironment('plugins.security.disabled', 'true');