Documentation
¶
Index ¶
- type DockerClient
- func (dc *DockerClient) Close(client *client.Client)
- func (dc *DockerClient) Create() (*client.Client, error)
- func (dc *DockerClient) ForcePullImage(imageName string) (finalImageName string, err error)
- func (dc *DockerClient) GetRegistryAuth(imageName string) (string, error)
- func (dc *DockerClient) PushImage(namespace string, imageName string) error
- type DockerClientRunner
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) 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.
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