-
Notifications
You must be signed in to change notification settings - Fork 258
[V2] Accessing LAN from inside docker container #637
Comments
It should "just work". You don't need to expose ports from your container because it isn't acting as the server; it's the client. IoT Edge instructs docker to set up all modules on their own network together (named For example, I have two Raspberry Pis on my desk, pi@pi1:~ $ docker run --rm -it --network azure-iot-edge ubuntu
root@794cf6ec95b4:/$ apt-get update && apt-get install --yes iputils-ping
root@794cf6ec95b4:/$ ping -c 3 172.168.0.2 Output of
Are you able to reproduce this? Do you perhaps have other network settings or firewalls getting in the way? |
@jessebean I noticed this in your description:
That error is happening because you inserted "createOptions" in your deployment as JSON. You need to serialize the JSON to a string instead. For example, the default "createOptions" for edgeHub looks like this:
Can your module talk to your SOAP server if you don't specify "createOptions"? If not, what's the error? |
@damonbarry As for accessing the server, I dug around and realized I was using the computer name and since Docker and my linux box aren't on Active Directory, I needed to use the IP address (facepalm). Thanks for the help! Everything is working! |
OS: Ubuntu 16.04
Arch: AMD64
Version: 2
Docker: Linux
Version: 18.06.0-dev (I think)
Okay!
I have built a custom module that is supposed to connect to another machine on my network that is hosting a SOAP server. It streams data the server to the hub. My only issue is I can't get the module to connect to the SOAP server. I know that the docker containers operate on their own network, and that I need to open some port for my module to connect to the server. Here is what I have\understand.
The port I am trying to access on the other machine is port 2011 via http. Following this issue, #561, I am trying to open up the port for my custom container to get the information off my LAN.
"createOptions": { "ExposedPorts": { "2011/http": {} }, "HostConfig": { "PortBindings": { "2011/http": [ { "HostPort": "2011" } ] } }
When I run with these create options, I get the error,
[Edge] Start deployment to [FB-IOT-STREAMING-DEVICE]
[Edge] Deployment failed. Error: Request failed with status code 400
[Edge] ErrorCode:ArgumentInvalid;Provided json is not a valid 'tags' or 'properties' object: arrays are not supported.
There is also another issue that is similar. In both of these there is said a way to make the container not connect to the docker network, but I can not find any documentation anywhere for how to do that. Or any documentation on the createOptions!
Any help would be greatly appreciated!
The text was updated successfully, but these errors were encountered: