switch to nspawn proxy
This commit is contained in:
parent
36891699c4
commit
b1ee328238
2 changed files with 13 additions and 10 deletions
|
@ -7,6 +7,7 @@ const log = log_from("nspawn");
|
|||
export function container_command(name: string, directory: string, opts?: {
|
||||
veth?: boolean;
|
||||
boot?: boolean;
|
||||
ports?: [number, number][];
|
||||
cmd_opts?: Deno.CommandOptions;
|
||||
}) {
|
||||
const args = [
|
||||
|
@ -15,6 +16,7 @@ export function container_command(name: string, directory: string, opts?: {
|
|||
];
|
||||
if (opts?.veth ?? false) args.push("--network-veth");
|
||||
if (opts?.boot ?? false) args.push("--boot");
|
||||
for (const [from, to] of opts?.ports ?? []) args.push(`--port=${from}:${to}`);
|
||||
const command = new Deno.Command("systemd-nspawn", { ...opts?.cmd_opts, args });
|
||||
return command;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue