Answer the question
In order to leave comments, you need to log in
How does Docker work in terms of networking?
Good day.
I'm sorry if the question seems banal, but I can't figure out how docker works with the network.
Suppose there is a dedik with centos installed, one network interface (one external ip address) and docker with two docker containers installed on this dedik.
Each docker container has the same packages installed, the difference is only in versions and configurations, let's say it's nginx, php, apache, memcache, mysql and something else.
The first docker container contains a project with the address test1.com, and the second one is test2.com, respectively.
Actually, the question itself is, how does the resolv of all this happen, because all requests will fall on a dedicated ip, which should be proxyed to the docker container? Or in general how it all works, I do not understand (
Answer the question
In order to leave comments, you need to log in
after all, all requests will fall on a dedicated ip, which should be proxyed to a docker container?
On a dedicated host, magic nginx can sit with magic rules for proxying different URLs to different containers.
Read about setting up a network in the official documentation. Everything is clearly written there.
In a nutshell: when creating a docker mesh, you create a virtual adapter with your own IP. The adapter works in bridge mode by default. How to send requests to this adapter further depends on your task.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question