Docker Community Forums

Share and learn in the Docker community.

Access to a docker machine from Android app


(Jm4rc05) #1

I’m trying to run my app final testing phase where I have to use several Android phones using a local network to access a web-service running at one server in the same network.

To start, the Android S.O. do not permit to access services of any kind in a local network. The only way to do this is enabling tethering on the phone and creating a hotspot using the phone and after that you have to connect your server to this hotspot. Done!

After that the Docker machine can’t be reached by other hosts (including the Android phone) outside the container machine. To enable that I created a third adapter using Virtualbox configuration and configured it to Bridged network. Done!

So far I have one Android phone accessing the local network and a docker container reachable by any host in the local network, but seems to me I can’t have both at the same time and I can’t figure out why!

When the the Docker container is connected to the network (the regular one) using the bridged third adapter I can reach it from any computer in this network!

But when the Docker container is connected to the Android phone hotspot, I can’t start any image and I can’t access the docker host using the Quickstart Terminal.

I’m missing something here but, as I said, I can’t figure out what!

Somebody have any idea? Thanks in advance!


(Jm4rc05) #2

I got some help from a sysadmin here and they pointed me the fact that our machines is configured to have fixed IP’s (so we can write our local tests scripts more easily) and when we got this ad-hoc network from the cell phone up no route is created between the local host and the virtual machine.

The solution is to either change to DHCP or to create a route between the networks.