From 0b998e5c230cdf458a390d0d9c28c85f21b9fbd2 Mon Sep 17 00:00:00 2001 From: Radostin Stoyanov Date: Tue, 6 Jun 2017 17:41:46 +0100 Subject: Cache downloaded container images Store container images downloaded with skopeo to avoid re-download. Allow user to disable this option by passing "--no-cache" parameter --- virt-bootstrap.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'virt-bootstrap.py') diff --git a/virt-bootstrap.py b/virt-bootstrap.py index 0e5952d..ee92f92 100755 --- a/virt-bootstrap.py +++ b/virt-bootstrap.py @@ -53,7 +53,11 @@ def get_source(args): try: class_name = "%sSource" % scheme.capitalize() clazz = getattr(sources, class_name) - return clazz(url, args.username, args.password, args.not_secure) + return clazz(url, + args.username, + args.password, + args.not_secure, + args.no_cache) except Exception: raise Exception("Invalid image URI scheme: '%s'" % url.scheme) @@ -106,6 +110,8 @@ def main(): "to connect to the source registry")) parser.add_argument("--root-password", default=None, help=_("Root password to set in the created rootfs")) + parser.add_argument("--no-cache", action="store_true", + help=_("Do not store downloaded Docker images")) # TODO add --format [qcow2,dir] parameter # TODO add UID / GID mapping parameters -- cgit