Question
Docker private network individual host access
Howdy,
We’re trying to bring up a DO docker host with 200 containers for testing our agent application and we cannot figure the network part. Let me explain:
- We are developing an application that is agent-based. An agent is installed on a host and it self-registers with a server to initiate on-going communication.
- The server then communicates with each host running an agent and send commands.
- The agents communicate back to the server with a message q
- Each agent needs its own ip and standard ports with which the server sends commands
I think we can do this with docker Host networking. My thoughts are (forgive my networking ignorance):
- we give the DO docker host an internal class-b like 172.99.x.x
- we launch 200+ agent containers in host mode and assign static (or dhcp) addresses to each from the class-b
- the server is on a remote host that vpns into the DO Docker Host
- hopefully the server can now “see” the class-b and all of its containers and the containers can communicate with the remote server
I know this is broken… where am i falling down.
Thanks!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×
Hi @Digitalocean719
Just a small note, it’s
172.16.0.0 - 172.31.255.255
as per Wikipedia.It’s a pretty big setup, so it’s difficult to understand all the details, but it sounds like that would be one way of setting it up.
@hansen I think some code of how you are trying to do this set up would help us understand better.
I would suggest using Docker Compose with Swarn mode, but about networks… I would suggest you have a very strict way on naming containers and instead using
ip:port
to connect to your containers, you usesever_name:port
to connect to it and let the Docker do the network trick for you.Here is how you could use Docker Network:
1. Create a Docker Network
As of Docker Network documentation
2. Use this network in your
docker-compose.yml
file:3. Connect any Container to your network
As of Docker Network documentation
Hope it helps!