mirror of
https://github.com/stan220/testcontainers-php.git
synced 2026-09-12 05:29:36 +00:00
fix issue with passing envs into the container. Remove container registry usage.
This commit is contained in:
@@ -4,24 +4,19 @@ declare(strict_types=1);
|
||||
|
||||
namespace Testcontainers\Container;
|
||||
|
||||
use Testcontainers\Wait\WaitForExec;
|
||||
|
||||
class MariaDBContainer extends GenericContainer
|
||||
{
|
||||
private function __construct(string $version, string $mysqlRootPassword)
|
||||
public function __construct(string $version = 'latest', string $mysqlRootPassword = 'root')
|
||||
{
|
||||
parent::__construct('mariadb:' . $version);
|
||||
$this->withExposedPorts(3306);
|
||||
$this->withEnvironment('MARIADB_ROOT_PASSWORD', $mysqlRootPassword);
|
||||
|
||||
$binary = 'mysqladmin';
|
||||
|
||||
if ($version === 'latest' || version_compare($version, '11.0.0', '>')) {
|
||||
$binary = 'mariadb-admin';
|
||||
}
|
||||
|
||||
$this->withWait(new WaitForExec([$binary, 'ping', '-h', '127.0.0.1']));
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use constructor instead
|
||||
* Left for backward compatibility
|
||||
*/
|
||||
public static function make(string $version = 'latest', string $mysqlRootPassword = 'root'): self
|
||||
{
|
||||
return new self($version, $mysqlRootPassword);
|
||||
|
||||
Reference in New Issue
Block a user