mirror of
https://github.com/stan220/testcontainers-php.git
synced 2026-11-07 16:02:38 +00:00
fix issue with passing envs into the container. Remove container registry usage.
This commit is contained in:
@@ -8,23 +8,36 @@ use Testcontainers\Wait\WaitForHttp;
|
||||
|
||||
class OpenSearchContainer extends GenericContainer
|
||||
{
|
||||
private function __construct(string $version)
|
||||
public function __construct(string $version = 'latest')
|
||||
{
|
||||
parent::__construct('opensearchproject/opensearch:' . $version);
|
||||
$this->withExposedPorts(9200);
|
||||
$this->withEnvironment('discovery.type', 'single-node');
|
||||
$this->withEnvironment('OPENSEARCH_INITIAL_ADMIN_PASSWORD', 'c3o_ZPHo!');
|
||||
$this->withWait(WaitForHttp::make(9200));
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use constructor instead
|
||||
* Left for backward compatibility
|
||||
*/
|
||||
public static function make(string $version = 'latest'): self
|
||||
{
|
||||
return new self($version);
|
||||
}
|
||||
|
||||
public function disableSecurityPlugin(): self
|
||||
public function withDisabledSecurityPlugin(): self
|
||||
{
|
||||
$this->withEnvironment('plugins.security.disabled', 'true');
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use withDisabledSecurityPlugin instead
|
||||
*/
|
||||
public function disableSecurityPlugin(): self
|
||||
{
|
||||
return $this->withDisabledSecurityPlugin();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user