From 7343816a5c6de7e54bfa21317239af4380c792b4 Mon Sep 17 00:00:00 2001 From: Radostin Stoyanov Date: Thu, 13 Apr 2017 15:06:35 +0100 Subject: Remove trailing slash after docker image Skopeo does not accept any trailing slash at the end of the url. See https://github.com/projectatomic/skopeo#copying-images. --- sources.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sources.py') diff --git a/sources.py b/sources.py index 7045a29..a7f1eb0 100644 --- a/sources.py +++ b/sources.py @@ -55,8 +55,9 @@ class DockerSource: self.username = username self.password = password self.insecure = insecure - if self.image.startswith('/'): - self.image = self.image[1:] + if self.image and not self.image.startswith('/'): + self.image = '/' + self.image + self.url = "docker://" + self.registry + self.image def unpack(self, dest): tmpDest = tempfile.mkdtemp('virt-bootstrap') @@ -67,7 +68,7 @@ class DockerSource: # they should place the certificates in the system # folders for broader enablement cmd = ["skopeo", "copy", - "docker://%s/%s" % (self.registry, self.image), + self.url, "dir:%s" % tmpDest] if self.insecure: cmd.append('--src-tls-verify=false') -- cgit