MCPcopy
hub / github.com/indigo-dc/udocker / load

Method load

udocker/docker.py:837–855  ·  view source on GitHub ↗

Load a Docker file created with docker save, mimic Docker load. The file is a tarball containing several layers, each layer has metadata and data content (directory tree) stored as a tar file.

(self, tmp_imagedir, imagerepo=None)

Source from the content-addressed store, hash-verified

835 return loaded_repositories
836
837 def load(self, tmp_imagedir, imagerepo=None):
838 """Load a Docker file created with docker save, mimic Docker
839 load. The file is a tarball containing several layers, each
840 layer has metadata and data content (directory tree) stored
841 as a tar file.
842 """
843 self._imagerepo = imagerepo
844 structure = self._load_structure(tmp_imagedir)
845 if not structure:
846 Msg().err("Error: failed to load image structure")
847 return []
848 if "repositories" in structure and structure["repositories"]:
849 repositories = self._load_repositories(structure)
850 else:
851 if not imagerepo:
852 imagerepo = Unique().imagename()
853 tag = Unique().imagetag()
854 repositories = self._load_image(structure, imagerepo, tag)
855 return repositories
856
857 def _save_image(self, imagerepo, tag, structure, tmp_imagedir):
858 """Prepare structure with metadata for the image"""

Callers 1

test_08_loadMethod · 0.95

Calls 8

_load_structureMethod · 0.95
_load_repositoriesMethod · 0.95
MsgClass · 0.90
UniqueClass · 0.90
errMethod · 0.80
imagenameMethod · 0.80
imagetagMethod · 0.80
_load_imageMethod · 0.80

Tested by 1

test_08_loadMethod · 0.76