images

package
v0.2.13 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2025 License: Apache-2.0 Imports: 21 Imported by: 1

Documentation

Overview

Package images handles container image management operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCompositeKeychain added in v0.1.6

func NewCompositeKeychain() authn.Keychain

NewCompositeKeychain creates a keychain that tries environment variables first, then falls back to the default keychain

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.

type RegistryImageManager added in v0.1.6

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

RegistryImageManager implements the ImageManager interface using go-containerregistry for direct registry operations without requiring a Docker daemon. However, for building images from Dockerfiles, it still uses the Docker client.

func NewRegistryImageManager added in v0.1.6

func NewRegistryImageManager(dockerClient *client.Client) *RegistryImageManager

NewRegistryImageManager creates a new RegistryImageManager instance

func (*RegistryImageManager) BuildImage added in v0.1.6

func (r *RegistryImageManager) BuildImage(ctx context.Context, contextDir, imageName string) error

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

func (*RegistryImageManager) ImageExists added in v0.1.6

func (r *RegistryImageManager) ImageExists(_ context.Context, imageName string) (bool, error)

ImageExists checks if an image exists locally in the daemon or remotely in the registry

func (*RegistryImageManager) PullImage added in v0.1.6

func (r *RegistryImageManager) PullImage(ctx context.Context, imageName string) error

PullImage pulls an image from a registry and saves it to the local daemon

func (*RegistryImageManager) WithKeychain added in v0.1.6

func (r *RegistryImageManager) WithKeychain(keychain authn.Keychain) *RegistryImageManager

WithKeychain sets the keychain for authentication

func (*RegistryImageManager) WithPlatform added in v0.1.6

func (r *RegistryImageManager) WithPlatform(platform *v1.Platform) *RegistryImageManager

WithPlatform sets the platform for the RegistryImageManager

Jump to

Keyboard shortcuts

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