Documentation
¶
Index ¶
- Constants
- Variables
- func Main(w io.Writer, args []string) error
- func NewAgentCommand() *cobra.Command
- func NewApplyCommand() *cobra.Command
- func NewBootCommand() *cobra.Command
- func NewBoxCommand() *cobra.Command
- func NewBuildCommand() *cobra.Command
- func NewCpCommand() *cobra.Command
- func NewDiffCommand() *cobra.Command
- func NewDockerdCommand() *cobra.Command
- func NewDoctorCommand() *cobra.Command
- func NewExecCommand() *cobra.Command
- func NewExecInitCommand() *cobra.Command
- func NewExplainCommand() *cobra.Command
- func NewImagesCommand() *cobra.Command
- func NewInitCommand() *cobra.Command
- func NewInspectCommand() *cobra.Command
- func NewKillCommand() *cobra.Command
- func NewLogsCommand() *cobra.Command
- func NewPruneCommand() *cobra.Command
- func NewPsCommand() *cobra.Command
- func NewPullCommand() *cobra.Command
- func NewRmCommand() *cobra.Command
- func NewRmiCommand() *cobra.Command
- func NewRunCommand() *cobra.Command
- func NewSandboxCommand() *cobra.Command
- func NewStatsCommand() *cobra.Command
- func NewStopCommand() *cobra.Command
- func NewUsernsHoldCommand() *cobra.Command
- func NewVersionCommand() *cobra.Command
- func Run() int
Constants ¶
const DefaultDockerHost = "unix:///var/run/box.sock"
DefaultDockerHost is the unix socket box serves the Docker-compatible API on by default. Point a Docker client (or Gitea's act_runner) at it with DOCKER_HOST=unix:///var/run/box.sock.
Variables ¶
var ErrNotPermitted = errors.New("operation not permitted")
Functions ¶
func Main ¶
Main is the entrypoint used by the actual main program, and by integration tests that drive the CLI in-process. It runs the command with the given args (which include the program name at args[0], as in os.Args) and directs the command's output to w.
func NewAgentCommand ¶
NewAgentCommand implements and returns the hidden agent command: the in-VM service that runs commands forwarded from a box client on macOS.
func NewApplyCommand ¶ added in v0.4.0
NewApplyCommand implements and returns the apply command.
func NewBootCommand ¶ added in v0.1.3
NewBootCommand implements and returns the boot command.
func NewBoxCommand ¶
NewBoxCommand returns the root cobra.Command for box.
func NewBuildCommand ¶
NewBuildCommand implements and returns the build command.
func NewCpCommand ¶
NewCpCommand implements and returns the cp command.
func NewDiffCommand ¶ added in v0.4.0
NewDiffCommand implements and returns the diff command.
func NewDockerdCommand ¶
NewDockerdCommand returns the `box dockerd` command: a long-lived process that serves a Docker Engine API-compatible socket backed by box, so tools that speak to a Docker daemon (e.g. Gitea act_runner) can drive box instead.
func NewDoctorCommand ¶
NewDoctorCommand implements and returns the version command.
func NewExecCommand ¶
NewExecCommand implements and returns the exec command.
func NewExecInitCommand ¶
NewExecInitCommand implements the hidden exec-init command. It is re-exec'd by `box exec` to run a command inside the container's joined namespaces (plus a fresh mount namespace); its configuration is passed through the environment (box.exec*), and the command argv as positional arguments.
func NewExplainCommand ¶ added in v0.2.2
NewExplainCommand implements and returns the explain command.
func NewImagesCommand ¶
NewImagesCommand implements and returns the images command.
func NewInitCommand ¶
NewInitCommand implements and returns init command. init command is called by reexec to apply namespaces.
It is a hidden command and requires root path and container id to run.
func NewInspectCommand ¶
NewInspectCommand implements and returns the inspect command.
func NewKillCommand ¶
NewKillCommand implements and returns the kill command.
func NewLogsCommand ¶
NewLogsCommand implements and returns the logs command.
func NewPruneCommand ¶
NewPruneCommand implements and returns the prune command.
func NewPsCommand ¶
NewPsCommand implements and returns the ps command.
func NewPullCommand ¶
NewPullCommand implements and returns the pull command.
func NewRmCommand ¶
NewRmCommand implements and returns the rm command.
func NewRmiCommand ¶
NewRmiCommand implements and returns the rmi command.
func NewRunCommand ¶
NewRunCommand implements and returns the run command.
func NewSandboxCommand ¶ added in v0.1.0
NewSandboxCommand implements the hidden sandbox command. It is re-exec'd by init (and by exec-init) as the last stage before the container command: it reduces the process's privileges — no_new_privs, the capability sets, the user switch — and then execve's the command. Its configuration arrives through the environment (box.sandbox*), the command argv as positional arguments.
It is a separate stage because the reduction has to be done by the process that execs, and Go cannot run code between fork and exec.
func NewStatsCommand ¶
NewStatsCommand implements and returns the stats command.
func NewStopCommand ¶
NewStopCommand implements and returns the stop command.
func NewUsernsHoldCommand ¶ added in v0.1.0
NewUsernsHoldCommand implements the hidden userns-hold command. It is re-exec'd
into a fresh user namespace purely so its parent can open
/proc/
func NewVersionCommand ¶
NewVersionCommand implements and returns the version command.
func Run ¶
func Run() int
Run runs the Main entrypoint and returns the process exit code: the container command's own status for a run/exec that ended non-zero, 1 for any other error, 0 on success. This is mostly useful to faciliate e2e integration testing of the CLI. It passes `os.Stdout` as the output `io.Writer` and `os.Args[:]` as the args passed to `Main`.
Types ¶
This section is empty.