dockerapi

package
v0.0.0-...-02e6b7d Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APIVersion    = "1.41"
	MinAPIVersion = "1.24"
)

APIVersion is the Docker Engine API version box advertises. Clients negotiate down to this; it must be recent enough that act/act_runner's minimum (currently well below this) is satisfied.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComponentVersion

type ComponentVersion struct {
	Name    string            `json:"Name"`
	Version string            `json:"Version"`
	Details map[string]string `json:"Details,omitempty"`
}

ComponentVersion is one entry in Version.Components.

type ErrorResponse

type ErrorResponse struct {
	Message string `json:"message"`
}

ErrorResponse is the standard Docker error body: {"message": "..."}.

type Info

type Info struct {
	ID                string `json:"ID"`
	Name              string `json:"Name"`
	ServerVersion     string `json:"ServerVersion"`
	Driver            string `json:"Driver"`
	DockerRootDir     string `json:"DockerRootDir"`
	OperatingSystem   string `json:"OperatingSystem"`
	OSType            string `json:"OSType"`
	Architecture      string `json:"Architecture"`
	NCPU              int    `json:"NCPU"`
	MemTotal          int64  `json:"MemTotal"`
	KernelVersion     string `json:"KernelVersion,omitempty"`
	IndexServerAddres string `json:"IndexServerAddress"`
	Containers        int    `json:"Containers"`
	ContainersRunning int    `json:"ContainersRunning"`
	ContainersPaused  int    `json:"ContainersPaused"`
	ContainersStopped int    `json:"ContainersStopped"`
	Images            int    `json:"Images"`
}

Info is the GET /info response (moby's types.Info subset). Only the fields clients tend to read are populated; everything else is omitted and treated as zero by clients.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server exposes a subset of the Docker Engine API over a unix socket, backed by box's own container runtime. It is the one long-lived box process: while it serves the socket it acts as the supervisor for the containers it starts (which otherwise run detached and are tracked via state.json on disk).

func NewServer

func NewServer() *Server

NewServer builds a Server with all supported routes registered.

func (*Server) Serve

func (s *Server) Serve(ctx context.Context, host string) error

Serve listens on the given host (only unix:// sockets are supported) and serves the Docker-compatible API until the context is cancelled.

type Version

type Version struct {
	Platform      struct{ Name string } `json:"Platform"`
	Components    []ComponentVersion    `json:"Components"`
	Version       string                `json:"Version"`
	APIVersion    string                `json:"ApiVersion"`
	MinAPIVersion string                `json:"MinAPIVersion"`
	GitCommit     string                `json:"GitCommit"`
	GoVersion     string                `json:"GoVersion"`
	Os            string                `json:"Os"`
	Arch          string                `json:"Arch"`
	KernelVersion string                `json:"KernelVersion,omitempty"`
	Experimental  bool                  `json:"Experimental"`
	BuildTime     string                `json:"BuildTime,omitempty"`
}

Version is the GET /version response (moby's types.Version subset). Clients read ApiVersion here (and the Api-Version header from /_ping) to negotiate.

Jump to

Keyboard shortcuts

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