ezgh sandboxes exec <sandbox> [-i] [-t] [flags] -- command [args...]Run a command in a sandbox and wait for it. Its output is written as it arrives, stdout to stdout and stderr to stderr. A suspended sandbox is resumed first. The command runs as the image’s user in the image’s working directory unless --user or --workdir says otherwise.
Without -i or -t, standard input isn’t read, and the command is ended after --timeout seconds (1 to 840, default 300). -i sends standard input to the command until it ends, and has no timeout. -t also gives the command a terminal, for a shell: ezgh sandboxes exec -t <sandbox> – sh.
The exit code is the command’s own; 128 + n when signal n ended it; 124 when it timed out. A command is never run twice: if the connection is lost while it runs, ezgh says so and doesn’t send it again.
Part of ezgh sandboxes.
Examples
ezgh sandboxes exec build -- make test
ezgh sandboxes exec build --env MODE=test --workdir /srv -- sh -c 'make && make install'
tar -C ./src -cf - . | ezgh sandboxes exec -i build -- tar -C /srv -xf -
ezgh sandboxes exec -t build -- shFlags
| Flag | Type | Default | Description |
|---|---|---|---|
--env |
string, repeatable | an environment variable for the command, KEY=VALUE; repeat for more | |
-i, --interactive |
boolean | send standard input to the command | |
--timeout |
int | 300 |
end the command after this many seconds, 1 to 840 (without -i or -t) |
-t, --tty |
boolean | give the command a terminal; implies -i | |
--user |
string | the user it runs as | |
--workdir |
string | the directory it runs in, an absolute path |
This command also takes the global flags.