Skip to content

Commit 66b3ed2

Browse files
committed
Add --chroot flag to CLI
Signed-off-by: Cong Wang <cwang@multikernel.io>
1 parent d07a00c commit 66b3ed2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/sandlock/cli.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ def cmd_run(args: argparse.Namespace) -> int:
2929
if args.strict:
3030
from ._seccomp import DEFAULT_ALLOW_SYSCALLS
3131
cli_kwargs["allow_syscalls"] = DEFAULT_ALLOW_SYSCALLS
32+
if args.chroot:
33+
cli_kwargs["chroot"] = args.chroot
3234
if args.privileged:
3335
cli_kwargs["privileged"] = True
3436
if args.fs_isolation:
@@ -181,6 +183,8 @@ def main() -> None:
181183
run_p.add_argument("-t", "--timeout", type=float, help="Timeout in seconds")
182184
run_p.add_argument("--strict", action="store_true",
183185
help="Allowlist mode: only permit known-safe syscalls")
186+
run_p.add_argument("--chroot", metavar="PATH",
187+
help="Use directory as root filesystem (requires --privileged)")
184188
run_p.add_argument("--privileged", action="store_true",
185189
help="Run as root inside a user namespace")
186190
run_p.add_argument("--net-bind", action="append", metavar="PORT",

0 commit comments

Comments
 (0)