docker

package
v0.0.0-...-e99c6c0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: GPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnavailable = errors.New("Docker is unavailable")

Functions

func CreateDefaultDockerNetwork

func CreateDefaultDockerNetwork() error

func GetComposeProject

func GetComposeProject(projectName, workDir string, yml []byte, env []byte, skipNormalization bool) (*types.Project, error)

func GetImagesFromDockerCompose

func GetImagesFromDockerCompose(env, yml []byte) ([]string, error)

func NewDockerClient

func NewDockerClient() (*client.Client, error)

func PullImage

func PullImage(imageName string) error

func SimplifyPorts

func SimplifyPorts(ports []containertypes.Port) []string

Types

type Client

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

func NewClient

func NewClient() (Client, error)

func NewClientWithExist

func NewClientWithExist(cli *client.Client) Client

func (Client) BuildImageWithProcessAndOptions

func (c Client) BuildImageWithProcessAndOptions(task *task.Task, tar io.ReadCloser, options types.ImageBuildOptions) error

func (Client) Close

func (c Client) Close()

func (Client) CreateNetwork

func (c Client) CreateNetwork(name string) error

func (Client) DeleteImage

func (c Client) DeleteImage(imageID string) error

func (Client) GetImageIDByName

func (c Client) GetImageIDByName(imageName string) (string, error)

func (Client) ImageExists

func (c Client) ImageExists(imageID string) (bool, error)

func (Client) ListAllContainers

func (c Client) ListAllContainers() ([]container.Summary, error)

func (Client) ListContainersByName

func (c Client) ListContainersByName(names []string) ([]container.Summary, error)

func (Client) NetworkExist

func (c Client) NetworkExist(name string) bool

func (Client) PullImageWithProcess

func (c Client) PullImageWithProcess(task *task.Task, imageName string) error

func (Client) PullImageWithProcessAndOptions

func (c Client) PullImageWithProcessAndOptions(task *task.Task, imageName string, options image.PullOptions) error

func (Client) PushImageWithProcessAndOptions

func (c Client) PushImageWithProcessAndOptions(task *task.Task, imageName string, options image.PushOptions) error

type ComposeProject

type ComposeProject struct {
	Version  string
	Services map[string]Service `yaml:"services"`
}

type Environment

type Environment struct {
	Variables map[string]string
}

func (*Environment) UnmarshalYAML

func (e *Environment) UnmarshalYAML(value *yaml.Node) error

type PortRange

type PortRange struct {
	Start PortRangeItem
	End   PortRangeItem
	Items []PortRangeItem
}

func MergePortRanges

func MergePortRanges(items []PortRangeItem) []PortRange

type PortRangeItem

type PortRangeItem struct {
	Key            string
	PublicPort     uint16
	PrivatePort    uint16
	HasPrivatePort bool
	Position       int
}

PortRangeItem describes the dimensions shared by Docker port range displays. Key contains dimensions that must stay equal (for example address, protocol, and an optional protection policy identity).

type Service

type Service struct {
	Image       string      `yaml:"image"`
	Environment Environment `yaml:"environment"`
	Volumes     []string    `yaml:"volumes"`
	ExtraHosts  []string    `yaml:"extra_hosts"`
	Restart     string      `yaml:"restart"`
}

Jump to

Keyboard shortcuts

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