0

Docker for Windows – Find Web application IP address and port number running in a Docker Container

This post shows how to find the Docker machine IP address and the port number  in order to access a web application running in a Docker container.

Requirements

Items and configurations used for this blog.

  • Windows 10 Enterprise
    • Administrator account or equivalent to run ipconfig command in the command-line
  • Docker for Windows (Product version: 18.06.0.19098)
    • Properly installed
  • A sample web application running in a Docker container

Find Docker Machine IP Address

There are two ways

Using ipconfig/all

Run the following in the command-line:

Look for the Ethernet Adapter vEthernet (DockerNAT) section in the listing.

Using docker-machine command

Run the following in the command-line:

Find Port number

This port is basically used Docker container to redirect to another “internal” port number known only within the container where a web server is listening to.

Run the following in the command-line:

and we get

Notice it points to 80/tcp? This refers to the “internal” port number mentioned above.

Access Web application

We use both the IP address and port in a web browser as follows

 

Karl San Gabriel

Karl San Gabriel

Java and Enterprise Technologies Expert