How does Docker from the point of view of the network?

Good time of day.

I apologize if the question seems trivial, but I can't figure out how docker works with a network.
Suppose we have a dedicated server with centos installed, one network interface (one external ip address) and the dedicated server installed docker with two docker containers.

Each docker container is installed the same packages, the only difference in the versions and configurations, suppose that nginx, php, apache, memcache, mysql and something else.
In the first docker container is the project address test1.com and the second test2.com respectively.

Actually the question is, how is resolv all this, after all the requests will fall on a dedicated ip that needs to proxy turns on docker container? Or even how it all works, I don't understand(
July 2nd 19 at 17:32
4 answers
July 2nd 19 at 17:34
Solution
after all the requests will fall on a dedicated ip that needs to proxy turns on docker container?


the queries falling in the port, due to this and the magic happens. Docker daemon also updates the routing rules in iptables.

https://fralef.me/docker-and-iptables.html here can you read more info how it works.
July 2nd 19 at 17:36
On a dedicated host can sit magic magic with nginx rules to proxy different URL in different containers.
the Docker gets their own subnet will be? how do these images work in terms of a network? I took a freewheeling two containers, they get local address to which I can knock over ip 192.168.0.1 kind? or what? n - Dannie_Gutmann77 commented on July 2nd 19 at 17:39
: There are different options and this including. - orin.Runte commented on July 2nd 19 at 17:42
and if not difficult, could you please guide to make, where is it described? - Dannie_Gutmann77 commented on July 2nd 19 at 17:45
July 2nd 19 at 17:38
July 2nd 19 at 17:40
Read about the network configuration in the official documentation. There, everything is clearly written.

If very briefly: creating a mesh of Docker You create a virtual adapter with its IP. Default adapter works in a mode bridge. As to further pull requests for this adapter depends on Your task.

Find more questions by tags NginxCentOSDocker