From: peusterm Date: Mon, 2 May 2016 19:21:14 +0000 (+0200) Subject: first version of docker pull functionality X-Git-Tag: v3.1~134^2~1 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=35ba405817a6114a78f3c6b6e7ee393afabe9f83;p=osm%2Fvim-emu.git first version of docker pull functionality --- diff --git a/src/emuvim/api/sonata/dummygatekeeper.py b/src/emuvim/api/sonata/dummygatekeeper.py index 58c9182..0767b7b 100644 --- a/src/emuvim/api/sonata/dummygatekeeper.py +++ b/src/emuvim/api/sonata/dummygatekeeper.py @@ -212,8 +212,11 @@ class Service(object): for k, v in self.vnfds.iteritems(): for vu in v.get("virtual_deployment_units"): if vu.get("vm_image_format") == "docker": - self.remote_docker_image_urls[k] = vu.get("vm_image") - LOG.debug("Found Docker image URL: %r" % self.remote_docker_image_urls[k]) + url = vu.get("vm_image") + if url is not None: + url = url.replace("http://", "") + self.remote_docker_image_urls[k] = url + LOG.debug("Found Docker image URL: %r" % self.remote_docker_image_urls[k]) def _build_images_from_dockerfiles(self): """ @@ -233,7 +236,11 @@ class Service(object): If the package contains URLs to pre-build Docker images, we download them with this method. """ # TODO implement this - pass + dc = DockerClient() + for url in self.remote_docker_image_urls.itervalues(): + LOG.info("Pulling image: %r" % url) + dc.pull(url, + insecure_registry=True) def _check_docker_image_exists(self, image_name): """