docker

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package docker provides Docker client functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// InspectImage returns detailed information about an image.
	InspectImage(ctx context.Context, imageRef string) (*ImageInspect, error)

	// GetImageHistory returns the history of an image.
	GetImageHistory(ctx context.Context, imageRef string) ([]ImageHistoryResponseItem, error)

	// ImageExists checks if an image exists locally.
	ImageExists(ctx context.Context, imageRef string) bool

	// PullImage pulls an image from a registry.
	PullImage(ctx context.Context, imageRef string) error

	// Close closes the client connection.
	Close() error
}

Client defines the interface for Docker operations.

func NewClient

func NewClient() (Client, error)

NewClient creates a new Docker client.

func NewClientWithOpts

func NewClientWithOpts(opts ...client.Opt) (Client, error)

NewClientWithOpts creates a new Docker client with custom options.

type ContainerConfig

type ContainerConfig struct {
	Hostname     string
	Domainname   string
	User         string
	AttachStdin  bool
	AttachStdout bool
	AttachStderr bool
	ExposedPorts map[string]struct{}
	Tty          bool
	OpenStdin    bool
	StdinOnce    bool
	Env          []string
	Cmd          []string
	Image        string
	Volumes      map[string]struct{}
	WorkingDir   string
	Entrypoint   []string
	OnBuild      []string
	Labels       map[string]string
	StopSignal   string
	StopTimeout  int
	Shell        []string
}

ContainerConfig holds container configuration.

type GraphDriverData

type GraphDriverData struct {
	Name string
	Data map[string]string
}

GraphDriverData stores information about the storage driver.

type ImageHistoryResponseItem

type ImageHistoryResponseItem struct {
	ID        string
	Created   int64
	CreatedBy string
	Tags      []string
	Size      int64
	Comment   string
}

ImageHistoryResponseItem represents an item in the image history.

type ImageInspect

type ImageInspect struct {
	ID              string
	RepoTags        []string
	RepoDigests     []string
	Parent          string
	Comment         string
	Created         time.Time
	Container       string
	ContainerConfig ContainerConfig
	DockerVersion   string
	Author          string
	Config          *ContainerConfig
	Architecture    string
	OS              string
	Size            int64
	VirtualSize     int64
	GraphDriver     GraphDriverData
	RootFS          RootFS
	Metadata        ImageMetadata
}

ImageInspect contains the result of inspecting an image.

type ImageMetadata

type ImageMetadata struct {
	LastTagTime time.Time
}

ImageMetadata contains image metadata.

type RootFS

type RootFS struct {
	Type   string
	Layers []string
}

RootFS describes the root file system of an image.

Jump to

Keyboard shortcuts

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