This question is a bit conceptual...
I start a service,
Docker runs container(s) on node(s) for this service,
I progress on this container(s),
As some point container(s) gets an exception an enters in an unrecovarable state...
At this point, I am not able to manage that one container or containers manually (to recover it, stop - start for instance) since Swarm is the manager of containers.
What is the best practice of keeping the state of containers? There is "docker container commit" for instance however, am i supposed to find on which node containers are started, find their container ids and commit them manually? Should I define cron jobs for this purpose. Otherwise, shouldn't I rely on Docker for such applications?
Thanks in advance.
Like Oliver suggests, any persistent data you have should be stored in docker volumes, maybe using a docker volume driver from the Store like REX-Ray.
You should have three general goals in your setup:
When you combine those three principles, it'll let Swarm solve your state and uptimes issues.