images

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2025 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Overview

Package images handles container image management operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerImageManager

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

DockerImageManager implements the ImageManager interface for Docker, or compatible runtimes such as Podman.

func NewDockerImageManager

func NewDockerImageManager(dockerClient *client.Client) *DockerImageManager

NewDockerImageManager creates a new DockerImageManager instance This is intended for the Docker runtime implementation.

func (*DockerImageManager) BuildImage

func (d *DockerImageManager) BuildImage(ctx context.Context, contextDir, imageName string) error

BuildImage builds a Docker image from a Dockerfile in the specified context directory

func (*DockerImageManager) ImageExists

func (d *DockerImageManager) ImageExists(ctx context.Context, imageName string) (bool, error)

ImageExists checks if an image exists locally

func (*DockerImageManager) PullImage

func (d *DockerImageManager) PullImage(ctx context.Context, imageName string) error

PullImage pulls an image from a registry

type ImageManager

type ImageManager interface {
	// ImageExists checks if an image exists locally
	ImageExists(ctx context.Context, image string) (bool, error)

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

	// BuildImage builds a Docker image from a Dockerfile in the specified context directory
	BuildImage(ctx context.Context, contextDir, imageName string) error
}

ImageManager defines the interface for managing container images. It has been extracted from the runtime interface as part of ongoing refactoring. It may be merged into a more general container management interface in future.

func NewImageManager

func NewImageManager(ctx context.Context) ImageManager

NewImageManager creates an instance of ImageManager appropriate for the current environment, or returns an error if it is not supported.

type NoopImageManager

type NoopImageManager struct{}

NoopImageManager is a no-op implementation of ImageManager.

func (*NoopImageManager) BuildImage

func (*NoopImageManager) BuildImage(_ context.Context, _, _ string) error

BuildImage does nothing for the no-op implementation.

func (*NoopImageManager) ImageExists

func (*NoopImageManager) ImageExists(_ context.Context, _ string) (bool, error)

ImageExists always returns false for the no-op implementation.

func (*NoopImageManager) PullImage

func (*NoopImageManager) PullImage(_ context.Context, _ string) error

PullImage does nothing for the no-op implementation.

Jump to

Keyboard shortcuts

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