Skip to content Skip to sidebar Skip to footer

Can't Access App Deployed With Docker And Google Cloud

I currently have a Linux Debian VM set up through Google Cloud Platform. I have docker installed and would like to start running application containers within it. I'm following the

Solution 1:

First, test to see if your service works at all. To do this, from the VM itself, run:

wget http://localhost:32768

or

curl http://localhost:32768

If that works, that means the service is operating properly, so let's move further with the debugging.

There may be two firewalls that are blocking external access to your docker process:

  1. the VM's OS firewall
  2. Google Compute Engine firewall

You can see if you're affected by the first issue by accessing the URL from the VM itself and from another VM on the same GCE network (use the VM name in the URL, not the external IP):

wget http://[vm-name]:32768

To fix the first issue, you would have to either open up the single port (recommended):

iptables -I INPUT -p tcp -s 0.0.0.0/0 --dport 32768 -j ACCEPT

or disable firewall entirely, e.g., by stopping iptables (not recommended).

If, after fixing this, you can access the URL from another host on the same GCE network, but still can't access it from outside of Google Compute Engine, you're affected by the second issue. To fix it, you will need to open the port in the GCE firewall; this can also be done via the web UI in the Developers Console.


Solution 2:

Create an entry in your local ssh config file as below with specific local forward port. In my case its an example of yarn's IP, which I want to access in browser.

Host hadoop
     HostName <External-IP>
     User <Local-machine-username>
     IdentityFile ~/.ssh/<private-key-for-above-user>
     LocalForward 8089 <Internal-IP>:8088

Post a Comment for "Can't Access App Deployed With Docker And Google Cloud"