Open aloneguid opened 5 years ago
@aloneguid - Try adding an EXPOSE statement to the first section of your Dockerfile.
Expose works, I posted this as workaround on another thread already but that seems like a bug to me?
Glad that worked, sorry I did not see the other thread, which one was it? The SF team is still looking into the root cause of this.
I've posted this on Azure advisors originally) found that the only difference between Web and console is expose command, nothing else is happening different, procmon says they fire up identicaly.
Gotcha, thanks.
@aloneguid You said the EXPOSE statement worked for you. Could you share your dockerfile or at least the portion that worked? I am trying to get my console Mesh application to talk to my local Cosmos emulator and a local SQL server instance and I can't get it to succeed. Thanks.
@jiffypopjr the dockerfile should start like this:
FROM microsoft/dotnet:2.1-runtime AS base
WORKDIR /app
EXPOSE 80 <--- extra line
FROM microsoft/dotnet:2.1-sdk AS build
WORKDIR /src
...
I've exposed both ports, in an attempt to get to the local Cosmos emulator, but this doesn't seem to work. How would I, in a 'worker' Mesh node, get to a local Cosmos instance running on the host system from within the container? I've tried the host name (with also launching Mesh with the -UseComputerName arg), and tried the various IP address that docker inspect provides, but with no success.
The host port for Cosmos is 8081. Thanks!
EXPOSE 80 EXPOSE 8081
@sridmad - Any ideas?
@jiffypopjr normally you would compose host name as "servicename.applicationname" -this will resolve both in local cluster and Azure well.
Are you trying to access emulator running in a container belonging to the same application, or your host machine?
Connectivity issue for console project or any image without EXPOSE statement is addressed in the runtime with 3.3.622 SDK.
@aloneguid I was trying to access the Cosmos emulator that is running in the host machine (https:/localhost:8081). After digging quite a bit, I found that I could use the servicefabric_nat Gateway IP address as the host address and at least was able to access my host instance of Seq logging; however, because the Cosmos emulator uses SSL, the container was unable to establish a trust relationship with the host. Thus far I've attempted to register the Cosmos host local certificate in the container as a CA, Root, and My with no success (RUN certutil -addstore "Root" ./DocumentDBEmulatorCertificate.cer). I may try running the cosmos emulator as a container itself and see if I can do container-to-container communication next. If that fails, I'll try using tcp for communication
@jiffypopjr , I have opened a different issue for connectivity to ports on machine IP.
@jiffypopjr Hi Josh, wondering if you got this working with Cosmos running in docker (either on the same container as the mesh application or via container to container communication)
The latest preview SDK 3.3.617 has some issues with code trying to get access to external network. For instance simple code:
will fail from console application when running on a local cluster ("no such host is known"). The funny thing is it will succeed when running in API app, therefore the issue is not with docker networking as I thought before. Does anyone have any pointers?