I have installed a docker container and it is working, but only on my local machine. I can access it through the specific container IP, but noone else can access this from another computer on the same local network. In other words how do I make my container reachable for other people?
OS: OSX 10.11.1
Docker toolbox: Docker version 1.9.1, build a34a1d5
You should expose the ports which your service inside container is listening on to the host.
For example if you are running apache httpd inside container on port 80 and other people in the same network want to access it you should do the following.
docker run -d -p 80:80 apache
In the example we are mapping port 80 of container to host port 80. So now others on your network can access port 80 of your host to hit port 80 of container.
Thanks for your comment, but you have misunderstood the issue. Problem is not accessing container from the host machine, but other computers on the local network. This is because docker-machine assigns an ip to the docker vm that is only visible from the host machine. My question is how can other computers on local network access my docker container.
Sorry, my bad. Now for your requirement you will have to run the boot2docker vm network in bridge mode so that your VM will get an IP in your LAN subnet. After that when you expose ports using -p other people in the network can access it using the ip which you got for the boot2docker vm. In virtualbox you should modify the Adapter 2 settings as shown. Btw the bridge interface in your case may vary.
@ranjandas Could please speak a little more clearly? perhaps with some more snapshots. The Same problem in window docker toolbox. Thank you in advance!
@ranjandas ,I have created a Docker Image for WebApplication. In ubuntu machine the IP Address is changing dynamically how to access that application with url.
I can Access my Application http://localhost:5000.But I need to give the url to other people…the IPAddress is changing dynamically how i have to give?
How this application will be accessed by other people?
I found the solution recently when I was trying to solve this problem. It is firewall issue where docker network adapter vEthernet (DockerNAT) is unidentified network and set to public network category and doesn’t allow remote access to docker container. And this needs to be resolved by adding Inbound rule in windows firewall section for windows create a rule that is suitable for your need.
Hi ,
Am new to docker.am trying to bring up one setup on linux.
Where i have 2 container i.e A and B and i have one proxy server X
I am able to send msges from A to X but am not able to send or ping from X to B.
I want to know how i can achive this.
By Dockert HOSt container have eth0 and eth1 interface
Container A is using eth0 to send packets from A to X and i want to use eth1 to recieve the packet from X
Can you please help me on this?
Hi!
I am also new to docker and even I got a lot of things working perfectly, I am completely failing on doing one simple thing:
I have one server running several docker container providing different services on different ports. Using the simple bridge network, this works totally fine. Example: Unifi Controller is http://192.168.1.5:8080 and UniFi Video is http://192.168.1.5:7080.
But by installing more and more services as docker containers, I run into difficulties as multiple ports are the same on different services. In addition, I want to switch some services to a secondary IP address that is not the one that is set as exposed host in my router.
I read a lot of complex 172.x.x.x internal docker networking and linking and such, but I cannot find a document that simply explains how to do the following:
Linux machine running on 192.168.1.5, docker container on that machine running on 192.168.1.6 and another one on 192.168.1.7 over the same physical network on that linux machine.
I have NAT and firewall running on my master router, I don’t want to add another layer of NAT or routing.