mirror of
https://github.com/stan220/testcontainers-php.git
synced 2026-09-08 16:29:29 +00:00
fix: mariadb startup with latest image
This commit is contained in:
Generated
+358
-499
File diff suppressed because it is too large
Load Diff
@@ -12,7 +12,14 @@ class MariaDBContainer extends Container
|
|||||||
{
|
{
|
||||||
parent::__construct('mariadb:' . $version);
|
parent::__construct('mariadb:' . $version);
|
||||||
$this->withEnvironment('MARIADB_ROOT_PASSWORD', $mysqlRootPassword);
|
$this->withEnvironment('MARIADB_ROOT_PASSWORD', $mysqlRootPassword);
|
||||||
$this->withWait(new WaitForExec(['mysqladmin', 'ping', '-h', '127.0.0.1']));
|
|
||||||
|
$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']));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function make(string $version = 'latest', string $mysqlRootPassword = 'root'): self
|
public static function make(string $version = 'latest', string $mysqlRootPassword = 'root'): self
|
||||||
|
|||||||
Reference in New Issue
Block a user