0
votes

I am planning to build n docker container with each container consisting of m services.

  1. Is this recommended? Depending on the hardware, and the docker container structure, what is the recommended or maximum number of services within a container? (considering the fact, that the selected services are cohesive, thus fulfilling similar semantic tasks)
  2. Why can't I find any documentation about failover descriptions with regard to the behavior of a container for specific cases like 1 of n services crash. Afaik, if one service crashes, the container reboots automatically. Is there a way to prevent this? I would have expected the application within the container to take care of a service restart instead.

EDIT:

Two more notes: You mentioned that multiple services would not be appropriate with regard to scaling, could you explain why? (didn't they plan those use-cases?) What about the application model I mentioned before? It is described on this link: Service Fabric support for containers

Service Fabric provides an application model in which a container represents an application host in which multiple service replicas are placed. Service Fabric also supports a guest executable scenario in which you don't use the built-in Service Fabric programming models but instead package an existing application, written using any language or framework, inside a container. This scenario is the common use-case for containers. You can also run Service Fabric services inside a container. Support for running Service Fabric services inside containers is currently limited.

When you create an application, the container is selected during the service creation stage. And it is possible to add further services to an existing application (while selecting container type again). Is the application itself regarded as a container, too? Wouldn't this be suitable? But in the quote I added, it only talks about one guest executable, not many. It is further explained at this page: Package and deploy containers as a Service Fabric application using Yeoman

It is quite confusing. There seem to have been considerations made for multi-server scenarios within a container, while you said that it is note recommended. Is it kind of in a beta stage?

Could you described your way to go? With one service in one container? Would I need to create an application with a container service first, and afterwards add that application to a docker base image which could be added to a cluster node?

1

1 Answers

0
votes

according to the ideology of containers - each container should have exactly one service. putting more than one service into a container is considered a bad practice. this would answer both of your questions.