Documentation
¶
Overview ¶
Package images handles container image management operations.
Index ¶
- func NewCompositeKeychain() authn.Keychain
- type DockerImageManager
- type ImageManager
- type NoopImageManager
- type RegistryImageManager
- func (r *RegistryImageManager) BuildImage(ctx context.Context, contextDir, imageName string) error
- func (r *RegistryImageManager) ImageExists(_ context.Context, imageName string) (bool, error)
- func (r *RegistryImageManager) PullImage(ctx context.Context, imageName string) error
- func (r *RegistryImageManager) WithKeychain(keychain authn.Keychain) *RegistryImageManager
- func (r *RegistryImageManager) WithPlatform(platform *v1.Platform) *RegistryImageManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCompositeKeychain ¶ added in v0.1.6
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 ¶
ImageExists checks if an image exists locally
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 ¶
ImageExists always returns false 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
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