-
Notifications
You must be signed in to change notification settings - Fork 463
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
Cannot set "ExtraHosts" for edgeAgent with Windows Containers #4939
Comments
Hi! Why do you need to add the extra hosts config to edgeAgent? It seems this is an issue with adding extra hosts in windows containers and the workaround it to set the IP and hostname in hosts file from Dockerfile (for custom modules). Thanks! |
My customer is deploying to an OT environment that does not have a DNS. They need to resolve the Azure IoT Hub URL: .azure-devices.net to the ExpressRoute endpoint. Is your suggestion to pull the edgeAgent code and add the host name when creating the container? |
I think for edgeAgent is not easy to add to the dockerfile, so I was looking for a workaround. It worked for me to set the IP and hostname in the hosts file on the device and then it was able to resolve it from the container. Would this be a reasonable workaround for them? |
Adding the ip and hostname to the device config would be a good workaround, but could not get that working. I just retested with the the following:
I could not successfully resolve a "ping" from within the contianer (eg docker exec -it ...). I am interested why that works for you and not for me. I'd be happy to setup a Teams meeting if you would like to view my environment. |
I was able to reproduce the issue even when not using edge runtime, it looks like an issue with moby. I am still looking into finding a solution for it. |
This issue is being marked as stale because it has been open for 30 days with no activity. |
Expected Behavior
ExtraHosts configured in createOptions should be available in the container.
Current Behavior
The name is not resolvable within the container
Steps to Reproduce
docker -H npipe:////./pipe/iotedge_moby_engine exec -it edgeAgent cmd
Context (Environment)
Output of
iotedge check
Click here
Device Information
Runtime Versions
Logs
aziot-edged logs
edge-agent logs
edge-hub logs
The text was updated successfully, but these errors were encountered: