Documentation
¶
Overview ¶
Package docker runs sandboxes as Docker containers on the machine the docker CLI talks to: for self-hosting. One container per thread, removed when it has been idle past its time. It uses the docker CLI, so it needs no SDK and follows your DOCKER_HOST and contexts. The TS runtime has the same adapter (DockerSandbox).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
// Image is what each sandbox runs. It needs sh; bash, Python and
// timeout are used when there. Default python:3.12-slim.
Image string
// Network is "none" (the default) or "all". Docker has no allow list by
// domain.
Network string
// Workdir is the folder commands start in. Default /workspace.
Workdir string
CPU float64
MemoryMiB int
// Ports to publish on 127.0.0.1, so GetURL can give them. Needs
// Network "all".
Ports []int
// Env holds environment variables every command sees.
Env map[string]string
// RunArgs are more docker run arguments, placed before the image.
RunArgs []string
// Docker is the docker CLI. Default docker on the PATH.
Docker string
}
Options shapes the provider.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider makes Docker sandboxes.