docker

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2025 License: MulanPSL-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DockerDaemonConfigFilePath = "/etc/docker/daemon.json"

	OverrideDockerConfig = `
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd
`
)

Variables

This section is empty.

Functions

func BaseConfig

func BaseConfig() error

func ConfigCgroupDriver

func ConfigCgroupDriver(driver string) error

func ConfigDataRoot

func ConfigDataRoot(dataRoot string) error

func ConfigDockerDaemon

func ConfigDockerDaemon(cgroupDriver, lowLevelRuntime string, dataRoot string, enableTls bool, tlsHost string, insecureRegis ...string) (err error)

func ConfigDockerTls

func ConfigDockerTls(tlsHost string) error

func ConfigInsecureRegistries

func ConfigInsecureRegistries(registries []string) error

func ConfigRuntime

func ConfigRuntime(runtime string) error

func GetDockerDaemonConfig

func GetDockerDaemonConfig(path string) (*dockerConfig.Config, error)

func OverrideDockerService

func OverrideDockerService() error

func WaitDockerReady

func WaitDockerReady() error

Types

type Client

type Client struct {
	Client *dockerapi.Client
	// contains filtered or unexported fields
}

func (*Client) Close

func (c *Client) Close()

func (*Client) EnsureContainerRun

func (c *Client) EnsureContainerRun(containerId string) (bool, error)

func (*Client) EnsureImageExists

func (c *Client) EnsureImageExists(image ImageRef) error

func (*Client) Ping

func (c *Client) Ping() error

func (*Client) Pull

func (c *Client) Pull(img ImageRef) error

Pull pulls an image from the Docker registry.

func (*Client) Push

func (c *Client) Push(img ImageRef) (io.ReadCloser, error)

Push pushes an image to the Docker registry.

func (*Client) RemoveContainer

func (c *Client) RemoveContainer(id string) error

func (*Client) Run

func (c *Client) Run(cs ContainerSpec) error

type ContainerSpec

type ContainerSpec struct {
	ContainerConfig  *container.Config
	HostConfig       *container.HostConfig
	NetworkingConfig *network.NetworkingConfig
	Platform         *specs.Platform
	ContainerName    string
}

type DockerClient

type DockerClient interface {
	Pull(image ImageRef) error
	Push(image ImageRef) (readCloser io.ReadCloser, err error)
	Run(cs ContainerSpec) error
	EnsureImageExists(image ImageRef) error
	EnsureContainerRun(containerId string) (bool, error)
	RemoveContainer(id string) error
	Ping() error
}

func NewDockerClient

func NewDockerClient() (DockerClient, error)

type ImageRef

type ImageRef struct {
	Image    string `json:"image"`
	Username string `json:"username"`
	Password string `json:"password"`
}

Jump to

Keyboard shortcuts

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