docker - Azure Container Instance - how to make my container accesable and recognized from outside?

%3CLINGO-SUB%20id%3D%22lingo-sub-2074377%22%20slang%3D%22en-US%22%3Edocker%20-%20Azure%20Container%20Instance%20-%20how%20to%20make%20my%20container%20accesable%20and%20recognized%20from%20outside%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2074377%22%20slang%3D%22en-US%22%3E%3CDIV%20class%3D%22votecell%20post-layout--left%22%3E%3CDIV%20class%3D%22js-voting-container%20grid%20jc-center%20fd-column%20ai-stretch%20gs4%20fc-black-200%22%3E%26nbsp%3B%3C%2FDIV%3E%3C%2FDIV%3E%3CDIV%20class%3D%22postcell%20post-layout--right%22%3E%3CDIV%20class%3D%22s-prose%20js-post-body%22%3E%3CP%3EI%20have%20windows%20container%20which%20should%20access%20to%20external%20VM%20database%20(that%20is%20not%20in%20container%2C%20lets%20say%20VM1)%20so%20I%20would%20define%20for%20them%20l2bridge%20network%20driver%20in%20order%20to%20use%20the%20same%20Virtual%20Network.%3C%2FP%3E%3CPRE%3Edocker%20network%20create%20-d%20%22l2bridge%22%20--subnet%2010.244.0.0%2F24%20--gateway%2010.244.0.1%20%0A-o%20com.docker.network.windowsshim.vlanid%3D7%20%0A-o%20com.docker.network.windowsshim.dnsservers%3D%2210.244.0.7%22%20my_transparent%3C%2FPRE%3E%3CP%3ESo%20I%20suppose%20we%20need%20to%20stick%20on%20this%20definitely.%20But%20now%20as%20well%20I%20need%20to%20make%20my%20container%20accessible%20from%20outside%2C%20on%20port%209000%2C%20from%20other%20containers%20as%20well%20as%20from%20other%20VMs.%20I%20suppose%20this%20has%20to%20be%20done%20based%20on%20its%20name%20(host%20name)%20since%20IP%20will%20be%20changed%20after%20the%20each%20restart.%20How%20I%20should%20make%20my%20container%20accessible%20from%20some%20other%20VM2%20virtual%20machine%20-%20Should%20I%20do%20any%20modifications%20within%20the%20network%20configuration%3F%20Or%20I%20just%20to%20make%20sure%20they%20are%20both%20using%20the%20same%20DNS%20server%3F%20Of%20course%20I%20will%20do%20the%20expose%20of%20the%20port%2C%20but%20should%20I%20do%20any%20kind%20of%20additional%20network%20configuration%20in%20order%20to%20allow%20traffic%20on%20that%20specific%20port%3F%20I've%20read%20that%20by%20default%20network%20traffic%20is%20not%20allowed%20and%20that%20Windows%20may%20block%20some%20thing.%3C%2FP%3E%3CP%3EI%20will%20appreciate%20help%20on%20this.%20Thanks%3C%2FP%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E
New Contributor
 

I have windows container which should access to external VM database (that is not in container, lets say VM1) so I would define for them l2bridge network driver in order to use the same Virtual Network.

docker network create -d "l2bridge" --subnet 10.244.0.0/24 --gateway 10.244.0.1 
-o com.docker.network.windowsshim.vlanid=7 
-o com.docker.network.windowsshim.dnsservers="10.244.0.7" my_transparent

So I suppose we need to stick on this definitely. But now as well I need to make my container accessible from outside, on port 9000, from other containers as well as from other VMs. I suppose this has to be done based on its name (host name) since IP will be changed after the each restart. How I should make my container accessible from some other VM2 virtual machine - Should I do any modifications within the network configuration? Or I just to make sure they are both using the same DNS server? Of course I will do the expose of the port, but should I do any kind of additional network configuration in order to allow traffic on that specific port? I've read that by default network traffic is not allowed and that Windows may block some thing.

I will appreciate help on this. Thanks

0 Replies