Skip to main content

Module docker_snapshot_resume

Module docker_snapshot_resume 

Source
Expand description

Steps around the docker commit of a snapshot resume (issue #224):

  • --snapshot-prepare <command> runs in the stopped original before the commit: docker start, docker exec ... sh -c <command>, and always a docker kill afterwards. Starting the original runs its own command again, so this is only for containers whose start is known to be safe.
  • Progress lines while docker commit runs, which prints nothing itself.
  • --remove-original-after <seconds>: remove the stopped original only if the replacement is still running after the delay.

Structs§

SnapshotReporter
Where the snapshot steps report: the execution log and notify.

Functions§

commit_with_progress
Run docker commit and report the elapsed time every interval.
format_elapsed
Format a duration the way the progress lines print it: “45s”, “12 min”.
progress_interval_seconds
remove_original_after
Remove the stopped original once the replacement has survived the delay. Returns the note describing what happened.
run_snapshot_prepare
Run --snapshot-prepare in the stopped original. A failure is reported and the snapshot continues with the files as they are.