docker

package
v0.14.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

func New

func New(opts Options) *Provider

New returns the provider.

func (*Provider) Connect

func (p *Provider) Connect(ctx context.Context, sandboxID string) (ports.Sandbox, error)

Connect implements ports.SandboxProvider.

func (*Provider) Create

Create implements ports.SandboxProvider.

func (*Provider) Name

func (p *Provider) Name() string

Name implements ports.SandboxProvider.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL