def _find_layers(img, id):
with closing(img.extractfile('%s/json' % id)) as fd:
f_content = fd.read()
if hasattr(f_content, "decode"):
f_content = f_content.decode()
info = json.loads(f_content)
log.debug('layer = %s', id)
for k in ['os', 'architecture', 'author', 'created']:
if k in info:
log.debug('%s = %s', k, info[k])
yield id
if 'parent' in info:
pid = info['parent']
for layer in _find_layers(img, pid):
yield layer
# --------------------------------------------------------------------------
# Public API
# --------------------------------------------------------------------------
评论列表
文章目录