docker

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

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

Builder handles Docker image building operations

func NewBuilder

func NewBuilder() (*Builder, error)

NewBuilder creates a new Docker builder

func (*Builder) BuildImage

func (b *Builder) BuildImage(ctx context.Context, contextPath, dockerfileName, tag string) error

BuildImage builds a Docker image from the specified context

func (*Builder) Close added in v0.1.2

func (b *Builder) Close() error

Close closes the Docker client connection

func (*Builder) GetImageHistory added in v0.1.2

func (b *Builder) GetImageHistory(ctx context.Context, imageID string) ([]image.HistoryResponseItem, error)

GetImageHistory retrieves the history of a Docker image

func (*Builder) GetImageInfo added in v0.1.2

func (b *Builder) GetImageInfo(ctx context.Context, imageID string) (*image.InspectResponse, error)

GetImageInfo retrieves information about a Docker image

func (*Builder) RemoveImage added in v0.1.2

func (b *Builder) RemoveImage(ctx context.Context, imageID string) error

RemoveImage removes a Docker image by ID or name

type ConfigResponse added in v0.3.0

type ConfigResponse struct {
	Created      time.Time `json:"created"`
	Architecture string    `json:"architecture"`
	OS           string    `json:"os"`
	History      []struct {
		Created    time.Time `json:"created"`
		CreatedBy  string    `json:"created_by"`
		EmptyLayer bool      `json:"empty_layer,omitempty"`
	} `json:"history"`
	RootFS struct {
		Type    string   `json:"type"`
		DiffIDs []string `json:"diff_ids"`
	} `json:"rootfs"`
}

ConfigResponse represents the image config blob

type DockerAuthEntry added in v0.3.0

type DockerAuthEntry struct {
	Auth string `json:"auth"` // base64(username:password)
}

DockerAuthEntry represents a single auth entry

type DockerConfig added in v0.3.0

type DockerConfig struct {
	Auths      map[string]DockerAuthEntry `json:"auths"`
	CredsStore string                     `json:"credsStore,omitempty"`
}

DockerConfig represents ~/.docker/config.json structure

type ImageMetadata added in v0.3.0

type ImageMetadata struct {
	Digest     string          `json:"digest"`
	Size       int64           `json:"size"`
	Created    time.Time       `json:"created"`
	LayerCount int             `json:"layer_count"`
	Layers     []LayerMetadata `json:"layers"`
}

ImageMetadata holds metadata fetched from registry without pulling full image

type LayerMetadata added in v0.3.0

type LayerMetadata struct {
	Digest    string  `json:"digest"`
	Size      int64   `json:"size"`
	SizeMB    float64 `json:"size_mb"`
	CreatedBy string  `json:"created_by"`
	Empty     bool    `json:"empty"`
}

LayerMetadata holds layer information from registry

type ManifestListResponse added in v0.3.0

type ManifestListResponse struct {
	SchemaVersion int    `json:"schemaVersion"`
	MediaType     string `json:"mediaType"`
	Manifests     []struct {
		MediaType string `json:"mediaType"`
		Size      int64  `json:"size"`
		Digest    string `json:"digest"`
		Platform  struct {
			Architecture string `json:"architecture"`
			OS           string `json:"os"`
			Variant      string `json:"variant,omitempty"`
		} `json:"platform"`
	} `json:"manifests"`
}

ManifestListResponse represents a multi-arch manifest list

type ManifestResponse added in v0.3.0

type ManifestResponse struct {
	SchemaVersion int    `json:"schemaVersion"`
	MediaType     string `json:"mediaType"`
	Config        struct {
		MediaType string `json:"mediaType"`
		Size      int64  `json:"size"`
		Digest    string `json:"digest"`
	} `json:"config"`
	Layers []struct {
		MediaType string `json:"mediaType"`
		Size      int64  `json:"size"`
		Digest    string `json:"digest"`
	} `json:"layers"`
}

ManifestResponse represents the OCI/Docker manifest

type RegistryClient added in v0.3.0

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

RegistryClient handles communication with container registries

func NewRegistryClient added in v0.3.0

func NewRegistryClient() *RegistryClient

NewRegistryClient creates a new registry client

func (*RegistryClient) GetImageMetadata added in v0.3.0

func (rc *RegistryClient) GetImageMetadata(ctx context.Context, imageName, tag, platform string) (*ImageMetadata, error)

GetImageMetadata fetches image metadata from registry without pulling the full image

func (*RegistryClient) ListTags added in v0.3.0

func (rc *RegistryClient) ListTags(ctx context.Context, imageName string, limit int) ([]TagInfo, error)

ListTags lists tags for an image from the registry

type TagInfo added in v0.3.0

type TagInfo struct {
	Name      string    `json:"name"`
	Digest    string    `json:"digest,omitempty"`
	CreatedAt time.Time `json:"created_at,omitempty"`
}

TagInfo contains information about a tag

Jump to

Keyboard shortcuts

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