docker

package
v0.0.0-...-528fac3 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(options ...ClientOption) (*client.Client, error)

NewClient creates a new Docker client with the given options.

func NewTLSConfig

func NewTLSConfig(certFile, keyFile, caFile string) (*tls.Config, error)

NewTLS creates a TLS configuration for the Docker client.

Types

type ClientOption

type ClientOption func(*client.Client) error

ClientOption defines the type for functional options.

func WithHost

func WithHost(host string) ClientOption

WithHost sets the host for the Docker client.

func WithTLS

func WithTLS(certFile, keyFile, caFile string) ClientOption

WithTLS sets the TLS configuration for the Docker client.

type Docker

type Docker struct {
	Ctx         context.Context
	Client      client.APIClient
	EncodedAuth string
}

Docker struct is used to pass Context and EncodedAuth around client.APIClient interface is used to make mock testing easier

func (*Docker) LoginDocker

func (d *Docker) LoginDocker(user, password, registryUri string) error

LoginDocker logs in registry with given credentials and sets encodedauth to Docker object for further use in other functions

func (*Docker) PruneAll

func (d *Docker) PruneAll() (uint64, error)

PruneAll prunes all unused and dangling docker objects

func (*Docker) PullDockerImage

func (d *Docker) PullDockerImage(imageRef string) error

PullDockerImage pulls a Docker image from a registry

Jump to

Keyboard shortcuts

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