0

How would you implement a system that allocates one docker container per connection?

For example, the service receives a connection on port $x. I would like to route that connection to a single container in my swarm, and that container will handle data from only that connection/client. When the client disconnects the container can be destroyed. I need at least as many containers in the swarm as connections, but ideally not many more (e.g. a few percent extra in case of failures).

Does docker swarm allow for this sort of control over load balancing? (Caveat: I'm new to Docker).

trbabb
  • 131
  • 3
  • This sounds more like a serverless architecture. eg AWS lambda – jordanm Oct 28 '19 at 21:20
  • AFAIK this is not possible with Docker without an add-ons and I have not heard of one. Knative supports this on Kubernetes. Google implemented this in the Google Cloud Run service. – John Hanley Nov 01 '19 at 18:34
  • I just noticed the Fn Project tonight that runs on Docker. I have no experience with Fn. https://fnproject.io/ – John Hanley Nov 02 '19 at 04:58

0 Answers0