Docker Community Forums

Share and learn in the Docker community.

How to keep the container alive when the primary process needs to restart to upgrade

We have a primary (java) process that is started with a shell script. That java process can be updated when its version changes. The update process involves the primary java process spawning another java program that will restart the primary after the update is applied.

What is the best way to keep the container alive while all of this is going on?


PS I understand that the correct way to do this is roll out updates with orchestration but this is a legacy system that we are trying to migrate quickly.

Keep containers alive during daemon downtime
Enable live restore. There are two ways to enable the live restore setting to keep containers alive when the daemon becomes unavailable. …
Live restore during upgrades. …
Live restore upon restart. …
Impact of live restore on running containers. …
Live restore and swarm mode.

Thanks lewis95!

After running into this issue and several others, we have had to scrap our plans to migrate to Docker at this time. It is simply not a good fit for us at this stage in its development (Docker, Swarm, Kubernetes). We will keep looking at it going forward and hope it will one day fit.