Hi I'm a little confused by what he's saying in this video <https://kodekloud.co . . .

Dale Cooper:
Hi I’m a little confused by what he’s saying in this video https://kodekloud.com/topic/demo-advanced-docker-run-features/

He says you can access a running container like jenkins at its port 8080 if you find the container’s internal ip. What does he mean by a container’s internal IP?

Regardless of wether or not I’m using a mac or another machine, it sounds like there are two IPS: one for the computer, the machine that has installed and runs docker, and one for the “docker host”, which manages the containers. I feel like he uses the word docker host in various ways.

Dale Cooper:
Also, he references the “UI of his docker host”. and I’m very confused by what he means by that. What is the UI of his docker host vs the UI of the computer he uses which has docker installed on it?

siva gatla:
Docker host is where you docker software running. If you install docker in your personal laptop, then it will become docker host.

And if you have a container which runs all web application on port 80 (or whatever), you can simply forward the port to your host machine and access the web app like “localhost:8080” (if you forwarded 80 to 8080)

Alistair Mackay:
Hi @Dale Cooper

Docker creates a virtual network in which to run containers. As mentioned by @siva gatla, the host is the machine running the docker software, e.g. your laptop.

Let’s look inside a running container to see the internal IP

docker run -d --name test wbitt/network-multitool
docker exec -it test /bin/sh

/ # ifconfig
eth0      Link encap:Ethernet  HWaddr 02:42:AC:11:00:02
          inet addr:172.17.0.2  Bcast:172.17.255.255  Mask:255.255.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:9 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1086 (1.0 KiB)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

From the output of ifconfig, we can see the interface eth0 connected to the docker network

The internal IP here is 172.17.0.2 and from the mask we can tell that the network created by docker is 172.17.0.0/16 which means the network can support 65536 IP addresses, so you can theoretically run 65534 containers, as the addresses 172.17.0.1 and 172.17.255.255 are reserved