0

Imagine a docker swarm setup with a worker and a servic that is constrainted to the worker.

If that worker was encountered into network connection issue to manager, then after a while it reconnected to the manager. We all know that the manager will "keep the service alive". But I realized that the manager is actually keeping the service by create a new container and then remove the old container. In this way the old container loss it's state.

Is there a way to bring the service alive by using the original container without making new one? Or any other workaround? The purpose here is to not remove the old container.

Chenglu
  • 1,757
  • 2
  • 14
  • 23
  • What is the state that you want to persist? – Faisal Jul 07 '20 at 10:32
  • everything, like running process, data on the disk – Chenglu Jul 07 '20 at 15:39
  • The data on the disk can be retained using Volume Mapping but persisting the running process can't be done as the process starts and stops with the container. The logs can also be retained though using volume mapping. – Faisal Jul 07 '20 at 21:58
  • but keeping running process is the main goal. Is there any workaround ? I just don't want the service restart my container. – Chenglu Jul 08 '20 at 01:48

0 Answers0