-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Description
I noticed when creating a new MySQLContainer like so
protected function setUp(): void
{
$this->container = MySQLContainer::make();
$this->container->withMySQLDatabase('pimcore');
$this->container->withMySQLUser('pimcore_user', 'pimcore');
try {
$this->container->run();
} catch (JsonException $e) {
$this->fail($e->getMessage());
}
}
but when checking out the docker container with docker ps and docker inspect there is no port mapped to the host (localhost). And then when I try to connect to it like so
$this->pdo = new PDO(
sprintf('mysql:host=%s;port=3306', $this->container->getAddress()),
'pimcore_user',
'pimcore',
);
host missing when inspecting the container
"Ports": {
"3306/tcp": null,
"33060/tcp": null
},
I get this timeout error
1) Tests\App\journey\ContactIntegrationTest::testGetAllAction
PDOException: SQLSTATE[HY000] [2002] Operation timed out
Metadata
Metadata
Assignees
Labels
No labels
