Exposing Docker Container to outside world

8/3/2020

I'm currently learning Kubernetes as part of a project and facing a small hurdle which I hope you guys can help me in crossing.

The ask is to build a docker application that can be accessed over the internet by anyone anywhere. Below are the steps I followed.

  1. I'm using Windows laptop
  2. I used VMWare Workstation to install Ubuntu 20 LTS.
  3. Inside Ubuntu, I've deployed my docker image - using ubuntu terminal
  4. Currently, the applications are accessible within the ubuntu (using Localhost as well as, the URL generated by minikube (using the command minikube services <application_name> --url.
  5. Since within Ubuntu my localhost is working I tried using the ip addr show to get my ubuntu's IP address and then tried accessing it from my windows machine and no result.

Now I want to use the postman installed on my windows machine to hit the container that's running within ubuntu.

I'm new to this entire process so apologies if my question sounds dumb.

-- TechEnthu
containers
docker
kubernetes
ubuntu

1 Answer

8/3/2020

First, make sure your network mode for your VMWare is "bridge" (as in here, for VirtualBox, but the same idea applies to VMWare Player)

Then you can use ngrok (as described in "Expose Docker Container services on the Internet using the ngrok docker image" from Lucas Jellema) to generates a public URL and ensures that all requests sent to that URL are forwarded to a local agent (running in its own, stand alone Docker container) that can then pass them on to the local service.

-- VonC
Source: StackOverflow