From f5aa47468f0b5c6aa8eb765178649155384ffc41 Mon Sep 17 00:00:00 2001 From: Nate Jones Date: Mon, 17 Dec 2018 14:50:56 -0800 Subject: [PATCH] Ensure destination image dump happens on the correct end Previously, the dest image dump would always happen locally, no matter which mode (push or pull) was in use. That meant that in push mode, there was no remote file to rsync to, resulting in a full rsync every time. --- docker-sync | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-sync b/docker-sync index abe0cad..07a9e17 100755 --- a/docker-sync +++ b/docker-sync @@ -80,15 +80,15 @@ def main(): common_parent = get_common_parent(source_family,all_dest) if common_parent: print("Found common parent: %s"%common_parent[:20]) - print("Dumping local parent".ljust(just_size,"."), end="", flush=True) - _, output = execute("docker save -o %s %s"%(file_name, common_parent)) + print("Dumping common parent".ljust(just_size,"."), end="", flush=True) + _, output = execute("docker save -o %s %s"%(file_name, common_parent), ssh=dest) check(output) else: print("Unable to find a common parent. Importing full image.") else: print("\n--> Updating '%s':\n"%name_tag) print("Dumping dest image".ljust(just_size,"."), end="", flush=True) - _, output = execute("docker save -o %s %s"%(file_name, name_tag), ssh=source) + _, output = execute("docker save -o %s %s"%(file_name, name_tag), ssh=dest) check(output) print("Dumping source image".ljust(just_size,"."), end="", flush=True)