aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/scripts/topo_container_copy.py
diff options
context:
space:
mode:
Diffstat (limited to 'resources/tools/scripts/topo_container_copy.py')
-rw-r--r--resources/tools/scripts/topo_container_copy.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/resources/tools/scripts/topo_container_copy.py b/resources/tools/scripts/topo_container_copy.py
index d243182236..088b7a4386 100644
--- a/resources/tools/scripts/topo_container_copy.py
+++ b/resources/tools/scripts/topo_container_copy.py
@@ -122,11 +122,16 @@ def main():
ssh.scp(local_path=image, remote_path=directory)
# Load image to Docker.
- cmd = "for f in {directory}/*.tar.gz; do zcat $f | "\
- "sudo docker load; done".format(directory=directory)
+ cmd = "for f in {directory}/*.tar.gz; do "\
+ "sudo docker load -i $f; done".format(directory=directory)
stdout = ssh_no_error(ssh, cmd)
print("###TI {}".format(stdout))
+ # Remove <none> images from Docker.
+ cmd = "docker rmi $(sudo docker images -f 'dangling=true' -q)"
+ stdout = ssh_no_error(ssh, cmd, sudo=True)
+ print("###TI {}".format(stdout))
+
if __name__ == "__main__":
sys.exit(main())