Docker Community Forums

Share and learn in the Docker community.

Pause Container for system reboot and unpause

docker

(Viktorgorte) #1

Hello everyone.

I have a process running in a docker container and I need to restart my system. Is it possible to pause the process and reboot my computer and unpause the process so that it continues to run from the point I had to pause it?
So I basically want to know if it is possible to “save” a process and resume it again.

Best regards,
Viktor


(Anand2011) #2

This is Docker swarm scenario that i have upgraded Docker engine.-

Docker swarm - Total 3 nodes, 1 leader node and 2 worker node.

Go to UCP and Select the Node you want upgrade docker engine. and click on configuration and select pause and Drain. your containers will be automatically moved to other nodes.

Once u click on pause. no New containers will be directed to the current node. so you can continue to upgrade docker engine and reboot your node.

once the node is up and go to the same node and click on configure and click on unpause . so now now containers can be moved to the current node

May be this helps you to understand usage of pause and unpause in docker swarm.


(Viktorgorte) #3

Thank you for your reply @anand2011. The thing is that I not only have to restart Docker, but my whole system, meaning I have to restart my PC. Do you know of a way saving the current process and resume it after the restart?


(Anand2011) #4

docker save

Description

Save one or more images to a tar archive (streamed to STDOUT by default)

Usage

docker save [OPTIONS] IMAGE [IMAGE...]

Below are Docker Life Cycle Commands


(Jjfraney) #5

No. There is no such capability in lightweight containers or in common operating systems like linux or windows.

Let me ask…can you think of such a capability offered on a non-docker system? For example, generally, in windows or linux, can I take a snapshot of a process, reboot the system, and then restore the snapshot to continue from there? I’m sure there is no such thing for processes running on a host. Do you know of one?

Most applications are designed to store their important state data in a persistent manner so the data will survive a crash or shutdown. Then, after reboot, as a new instance of process is started, it reads the important state data from storage. Using the state data, the application figures out for itself where it left off.

I could be wrong in understanding what you are seeking.