Replies: 4 comments
-
The only time I think it's appropriate is when you have multiple processes that must work together in a non-network way to provide a single service in a strict 1-to-1 relationship. php-fpm + nginx is like this. Both are needed to complete a web request, and having them in two containers so that every incoming request has to pass through nginx, back over the network to php-fpm, and then be returned just adds to the complexity of the solution and adds network delay. For that use case, I recommend using supervisord like Docker suggests, but it's really the only good example I have for when to do that. Almost every other time I see people trying to stick two binaries in the same running container, it's an antipattern, and at best it limits flexibility (they will always have a 1-to-1 relationship) and at worst adds complexity and potential issues when one of the apps malfunctions but the container isn't killed because "supervisord is still running". |
Beta Was this translation helpful? Give feedback.
-
Hey Bret, your answer above seems to be related to running upstart in a container, but @geekdave 's question is about starting/restarting containers on the host system. Is there a way to bridge the Or are the two basically in opposition to one another? |
Beta Was this translation helpful? Give feedback.
-
OK then, @geekdave didn't specify. Docker swarm manages all service tasks across the swarm. Nodes going down will cause tasks (containers) to be restarted on other nodes, so no, at the host level in a swarm, you would only have docker installed on hosts and nothing else would be needed to manage containers. Does that help? |
Beta Was this translation helpful? Give feedback.
-
@BretFisher 👍 thanks |
Beta Was this translation helpful? Give feedback.
-
The docker docs seem to say it's OK to use unix process managers to start docker containers, as long as you are consistent about it.
Consistency aside, I'm curious if there are any compelling reasons for or against this.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions