parser.add_argument("--daemon", "-d", action="store_true",
help=_("run in the background"))
+parser.add_argument("--storage-type", "-s", type=str, default=None,
+ choices=("tmpfs", "dir"),
+ help=("type of storage use by the container"))
+
parser.add_argument("--union-type", "-U", type=str, default="overlayfs",
choices=("overlayfs", "aufs"),
help=_("type of union (overlayfs or aufs), "
"defaults to overlayfs."))
parser.add_argument("--keep-data", "-k", action="store_true",
- help=_("Use a persistent backend instead of tmpfs."))
+ help=_("don't wipe everything clean at the end"))
parser.add_argument("command", metavar='CMD', type=str, nargs="*",
help=_("Run specific command in container "
if args.command and args.daemon:
parser.error(_("You can't use -d and a command at the same time."))
+## Check that -k isn't used with -s tmpfs
+if not args.storage_type:
+ if args.keep_data:
+ args.storage_type = "dir"
+ else:
+ args.storage_type = "tmpfs"
+
+if args.keep_data and args.storage_type == "tmpfs":
+ parser.error(_("You can't use -k with the tmpfs storage type."))
+
## The user needs to be uid 0
if not os.geteuid() == 0:
parser.error(_("You must be root to run this script. Try running: sudo %s"
target = "%s/delta%s" % (dest_path, count)
fd.write("mkdir -p %s %s\n" % (target, entry[1]))
- if not args.keep_data:
+ if args.storage_type == "tmpfs":
fd.write("mount -n -t tmpfs none %s\n" % (target))
if args.union_type == "overlayfs":
# Deal with the case where we just attach to the container's console
if not args.command and not args.daemon:
- dest.console(tty=1)
+ dest.console()
dest.shutdown(timeout=5)
sys.exit(0)