dockerclient

package
v0.0.0-...-7ea8f00 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerClient

type DockerClient struct {
	Action  *action.Action
	ExecSvc execsvc.CommandRunner
}

DockerClient provides functionality for Docker operations

func New

func New(action *action.Action, execSvc execsvc.CommandRunner) *DockerClient

New creates a new DockerClient instance

func (*DockerClient) Close

func (dc *DockerClient) Close(client *client.Client)

func (*DockerClient) Create

func (dc *DockerClient) Create() (*client.Client, error)

func (*DockerClient) ForcePullImage

func (dc *DockerClient) ForcePullImage(imageName string) (finalImageName string, err error)

func (*DockerClient) GetRegistryAuth

func (dc *DockerClient) GetRegistryAuth(imageName string) (string, error)

GetRegistryAuth resolves the credentials stored by `docker login` for the registry that hosts imageName and returns them in the encoded form the Docker API expects as RegistryAuth. Source selection follows the Docker CLI: the credential helper bound to the registry (credHelpers, keyed by the host or, for Docker Hub, by https://index.docker.io/v1/), else the default credential store (credsStore), and only when neither is configured the static auths entry; a configured helper's answer is final, a miss is not a fallback to auths. An empty string means no credentials were found, i.e. an anonymous pull.

func (*DockerClient) PushImage

func (dc *DockerClient) PushImage(namespace string, imageName string) error

type DockerClientRunner

type DockerClientRunner interface {
	Create() (*client.Client, error)
	Close(client *client.Client)
	PushImage(namespace string, imageName string) error
	ForcePullImage(imageName string) (finalImageName string, err error)
	GetRegistryAuth(imageName string) (string, error)
}

TODO Add testcontainers tests DockerClientRunner defines the interface for Docker client operations

Jump to

Keyboard shortcuts

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