Merge pull request #37 from rw4lll/fix/35-with-network-option-fails

Fix #35 fails when run container using withNetwork()
This commit is contained in:
Shyim
2025-03-06 19:52:33 +01:00
committed by GitHub
+6 -3
View File
@@ -411,9 +411,12 @@ class GenericContainer implements TestContainer
if ($this->networkName !== null) {
$networkingConfig = new NetworkingConfig();
$endpointsConfig = new \ArrayObject([
$this->networkName => new EndpointSettings(),
]);
$endpointsConfig = [
$this->networkName => new EndpointSettings([
'networkID' => $this->networkName,
'aliases' => $this->name ? [$this->name] : [],
]),
];
$networkingConfig->setEndpointsConfig($endpointsConfig);
$containerCreatePostBody->setNetworkingConfig($networkingConfig);
}