-
-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WaitForPort hangs forever. #92
Comments
@maurovisintin Do you have some sort of firewall rules or otherwise routing table that is not correct? I've wrote a unit test to simulate your setup on my local as follows [TestMethod]
public void Issue92()
{
using (var c = Fd.UseContainer()
.WithName("profiles-smtp-server")
.UseImage("mailhog/mailhog:latest")
.ReuseIfExists()
.ExposePort(5011, 8025)
.ExposePort(1025)
.WaitForPort("8025/tcp", TimeSpan.FromSeconds(30))
.Build())
{
c.Start();
var response = $"http://{c.ToHostExposedEndpoint("8025/tcp")}/".Wget().Result;
IsTrue(response.IndexOf("<title>MailHog</title>", StringComparison.Ordinal) != -1);
}
} and it works fine. Can you do a |
Thanks for the quick response. |
Yes, but not on your IP address since fluentdocker resolves the IP address and do not use localhost. Can you, please, try to access using the IP address from chrome instead and see if you get the same behaviour? Cheers, |
I tried with my Private IP Address, |
Hmm... do your computer have both a private and public ip address? It seems that the framework choose your public in that case |
Actually |
@maurovisintin It resolves your address using the container network configuration - so it is the address of the container (doing docker inspect and checks the network section of the container). I'm adding a way to specify which address to use when doing the waitfor operation thus it is possible to do e.g. using (var c = Fd.UseContainer()
.WithName("profiles-smtp-server")
.UseImage("mailhog/mailhog:latest")
.ReuseIfExists()
.ExposePort(5011, 8025)
.ExposePort(1025)
.WaitForPort("8025/tcp", TimeSpan.FromSeconds(30), "127.0.0.1")
.Build())
{
c.Start();
var port = c.ToHostExposedEndpoint("8025/tcp").Port;
var response = $"http://127.0.0.1:{port}/".Wget().Result;
IsTrue(response.IndexOf("<title>MailHog</title>", StringComparison.Ordinal) != -1);
}
} In this example it will use the loopback to call the container if e.g. bound to 0.0.0.0 |
If the resolved container IP is not reachable it is possible to specify an IP address that is should use again. This relates to Issue #92. Set version to 2.7.0
@maurovisintin Do you have the ability to clone the master and test the extension on Cheers, |
@maurovisintin I've pushed release 2.7.0 to nuget - no need to clone. However, if you find the root cause of the problem I would really like to have that feedback and how you have setup your networking. It may take some time before 2.7.0 is indexed/published on nuget Cheers, |
It works, thanks for the support! |
Running the following snippet:
I can see the log info for the container starting, but never get to the "started" message.
The process waits indefinitely for the port.
After some minutes I get:
I see the container running
and I can successfully access to mailhog ui at
http://localhost:5011/
The text was updated successfully, but these errors were encountered: