-
Hello, I'm trying to write a test which has a dependency on azure storage, so I was experimenting with using the azurite image since that would make it easy to reproduce the condition(s) both locally and in our CI/CD pipelines. I managed to get the Azurite container working with the method below. (the test containers azurite package did not work for me). container = new ContainerBuilder()
.WithImage("mcr.microsoft.com/azure-storage/azurite")
.WithPortBinding(10000, true)
.WithPortBinding(10001, true)
.WithPortBinding(10002, true)
.WithOutputConsumer(this.consumer)
.WithWaitStrategy(Wait.ForUnixContainer()
.UntilMessageIsLogged("listening"))
.Build(); If I start a container with the same latest azurite image from podman desktop manually, I can successfully make a request. What I've seen inspecting the deployment is that the main difference is that testcontainers deploys it with hostip Does someone know what the culprit might be? and if I can make it visible what commands / request are being done to podman? so that I can rule out any difference(s). |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
Which hostname do you use to connect to the container? Using
Docker has a known issue where it assigns different random host ports to the IPv4 and IPv6 addresses. To avoid encountering this issue, Testcontainers binds the port to the IPv4 address. By using the container's
To resolve the correct port for localhost (whether it's IPv4 or IPv6), we need to implement #825. However, when using Testcontainers, it is always recommended to use the |
Beta Was this translation helpful? Give feedback.
I've asked for some help in the podman repo, the issue was resolved by switching the podman machine to rootless :)
See the discussion here for more info:
containers/podman#20331