diff options
author | Radostin Stoyanov <rstoyanov1@gmail.com> | 2017-06-06 17:41:46 +0100 |
---|---|---|
committer | Cédric Bosdonnat <cbosdonnat@suse.com> | 2017-06-07 09:55:34 +0200 |
commit | 0b998e5c230cdf458a390d0d9c28c85f21b9fbd2 (patch) | |
tree | 702075ca5d63ce8f50e0d0ff0dfccd829a96ebe7 /virt-bootstrap.py | |
parent | 4c45f1771bd1ba655294ff325553fb5eba770f65 (diff) | |
download | virt-bootstrap.git-0b998e5c230cdf458a390d0d9c28c85f21b9fbd2.tar.gz virt-bootstrap.git-0b998e5c230cdf458a390d0d9c28c85f21b9fbd2.tar.xz virt-bootstrap.git-0b998e5c230cdf458a390d0d9c28c85f21b9fbd2.zip |
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
Diffstat (limited to 'virt-bootstrap.py')
-rwxr-xr-x | virt-bootstrap.py | 8 |
1 files changed, 7 insertions, 1 deletions
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 |