def save_dependency(self, to_file):
dot = graphviz.Digraph(comment='Docker Images Dependency')
dot.body.extend(['rankdir=LR'])
for image in self.images:
if image['status'] not in ['matched']:
continue
dot.node(image['name'])
if image['parent'] is not None:
dot.edge(image['parent']['name'], image['name'])
with open(to_file, 'w') as f:
f.write(dot.source)
评论列表
文章目录