def _make_image(self, image, img_struct, deep=False, remote=False): img_obj = Image(image, remote=remote) img_obj.backend = self if not remote: img_obj.id = img_struct['Id'] img_obj.repotags = img_struct['RepoTags'] img_obj.created = img_struct['Created'] img_obj.size = img_struct['Size'] img_obj.virtual_size = img_struct['VirtualSize'] img_obj.original_structure = img_struct if deep: img_obj.deep = True img_obj.repotags = img_struct['RepoTags'] img_obj.config = img_struct['Config'] or {} img_obj.labels = img_obj.config.get("Labels", None) img_obj.os = img_struct['Os'] img_obj.arch = img_struct['Architecture'] img_obj.graph_driver = img_struct['GraphDriver'] img_obj.version = img_obj.get_label('Version') img_obj.release = img_obj.get_label('Release') img_obj.parent = img_struct['Parent'] img_obj.original_structure = img_struct img_obj.cmd = img_obj.original_structure['Config']['Cmd'] return img_obj
def _make_image(self, image, img_struct, deep=False, remote=False): img_obj = Image(image, remote=remote) img_obj.backend = self if not remote: img_obj.id = img_struct["Id"] img_obj.repotags = img_struct["RepoTags"] img_obj.created = img_struct["Created"] img_obj.size = img_struct["Size"] img_obj.virtual_size = img_struct["VirtualSize"] img_obj.original_structure = img_struct if deep: img_obj.deep = True img_obj.repotags = img_struct["RepoTags"] img_obj.config = img_struct["Config"] or {} img_obj.labels = img_obj.config.get("Labels", None) img_obj.os = img_struct["Os"] img_obj.arch = img_struct["Architecture"] img_obj.graph_driver = img_struct["GraphDriver"] img_obj.version = img_obj.get_label("Version") img_obj.release = img_obj.get_label("Release") img_obj.parent = img_struct["Parent"] img_obj.original_structure = img_struct img_obj.cmd = img_obj.original_structure["Config"]["Cmd"] return img_obj
def _make_image(self, image, img_struct, deep=False, remote=False): img_obj = Image(image, remote=remote) img_obj.backend = self if not remote and not deep: img_obj.size = img_struct['size'] img_obj.virtual_size = img_obj.size img_obj.version = img_obj.version img_obj.repotags = img_struct['names'] if not remote: try: img_obj.id = img_struct['id'] except KeyError: img_obj.id = img_struct['ID'] try: img_obj.created = DT.datetime.strptime( img_struct['created'], "%b %d, %Y %H:%M").strftime("%Y-%m-%d %H:%M") except KeyError: img_obj.created = time.mktime( time.strptime(img_struct['Created'].split(".")[0], "%Y-%m-%dT%H:%M:%S")) try: img_obj.size = img_struct['size'] except KeyError: img_obj.size = img_struct['Size'] try: img_obj.digest = img_struct['digest'] except KeyError: img_obj.digest = img_struct['Digest'] if deep: img_obj.deep = True img_obj.repotags = img_struct['Tags'] img_obj.config = img_struct['Config'] or {} img_obj.labels = img_obj.config.get("Labels", None) img_obj.os = img_struct['OS'] img_obj.arch = img_struct['Architecture'] img_obj.graph_driver = img_struct['GraphDriver'] img_obj.version = img_obj.get_label('Version') img_obj.release = img_obj.get_label('Release') # kpod inspect has no Parent right now #img_obj.parent = img_struct['Parent'] img_obj.original_structure = img_struct img_obj.cmd = img_obj.original_structure['Config']['Cmd'] return img_obj
def _make_image(self, image, img_struct, deep=False, remote=False): img_obj = Image(image, remote=remote) img_obj.backend = self if not remote and not deep: img_obj.size = img_struct['size'] img_obj.virtual_size = img_obj.size img_obj.version = img_obj.version img_obj.repotags = img_struct['names'] if not remote: try: img_obj.id = img_struct['id'] except KeyError: img_obj.id = img_struct['ID'] try: img_obj.created = DT.datetime.strptime(img_struct['created'], "%b %d, %Y %H:%M").strftime("%Y-%m-%d %H:%M") except KeyError: img_obj.created = time.mktime(time.strptime(img_struct['Created'].split(".")[0], "%Y-%m-%dT%H:%M:%S")) try: img_obj.size = img_struct['size'] except KeyError: img_obj.size = img_struct['Size'] try: img_obj.digest = img_struct['digest'] except KeyError: img_obj.digest = img_struct['Digest'] if deep: img_obj.deep = True img_obj.repotags = img_struct['Tags'] img_obj.config = img_struct['Config'] or {} img_obj.labels = img_obj.config.get("Labels", None) img_obj.os = img_struct['OS'] img_obj.arch = img_struct['Architecture'] img_obj.graph_driver = img_struct['GraphDriver'] img_obj.version = img_obj.get_label('Version') img_obj.release = img_obj.get_label('Release') # kpod inspect has no Parent right now #img_obj.parent = img_struct['Parent'] img_obj.original_structure = img_struct img_obj.cmd = img_obj.original_structure['Config']['Cmd'] return img_obj