May 2017
Beginner
300 pages
7h 26m
English
In the previous section, we saw how a -p 80:80 option did the magic, didn't we? Well, in reality, under the hood, the Docker Engine achieves this seamless connectivity by automatically configuring the Network Address Translation (NAT) rule in the Linux iptables configuration files.
To illustrate the automatic configuration of the NAT rule in Linux iptables, let's query the Docker hosts iptables for its NAT entries, as follows:
$ sudo iptables -t nat -L -n
The ensuing text is an excerpt from the iptables NAT entry, which is automatically added by the Docker Engine:
Chain DOCKER (2 references)target prot opt source destinationDNAT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 to:172.17.0.14:80
From the preceding excerpt, it is ...
Read now
Unlock full access