docker

package
v0.0.0-...-15868fb Latest Latest
Warning

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

Go to latest
Published: May 1, 2019 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RetrieveImage = retrieveImage

RetrieveImage is overridden for unit testing

Functions

func CreateDockerTarContext

func CreateDockerTarContext(ctx context.Context, w io.Writer, workspace string, a *latest.DockerArtifact, insecureRegistries map[string]bool) error

func GetBuildArgs

func GetBuildArgs(a *latest.DockerArtifact) ([]string, error)

GetBuildArgs gives the build args flags for docker build.

func GetDependencies

func GetDependencies(ctx context.Context, workspace string, dockerfilePath string, buildArgs map[string]*string, insecureRegistries map[string]bool) ([]string, error)

GetDependencies finds the sources dependencies for the given docker artifact. All paths are relative to the workspace.

func NormalizeDockerfilePath

func NormalizeDockerfilePath(context, dockerfile string) (string, error)

NormalizeDockerfilePath returns the absolute path to the dockerfile.

func Prune

func Prune(ctx context.Context, out io.Writer, images []string, client LocalDaemon) error

func RemoteDigest

func RemoteDigest(identifier string, insecureRegistries map[string]bool) (string, error)

func RetrieveRemoteConfig

func RetrieveRemoteConfig(identifier string, insecureRegistries map[string]bool) (*v1.ConfigFile, error)

RetrieveRemoteConfig retrieves the remote config file for an image

func ValidateDockerfile

func ValidateDockerfile(path string) bool

ValidateDockerfile makes sure the given Dockerfile is existing and valid.

func WalkWorkspace

func WalkWorkspace(workspace string, excludes, deps []string) (map[string]bool, error)

Types

type AuthConfigHelper

type AuthConfigHelper interface {
	GetAuthConfig(registry string) (types.AuthConfig, error)
	GetAllAuthConfigs() (map[string]types.AuthConfig, error)
}

AuthConfigHelper exists for testing purposes since GetAuthConfig shells out to native store helpers. Ideally this shouldn't be public, but the LocalBuilder needs to use it.

var (
	// DefaultAuthHelper is exposed so that other packages can override it for testing
	DefaultAuthHelper AuthConfigHelper
)

type BuildResult

type BuildResult struct {
	ID string
}

BuildResult gives the information on an image that has been built.

type ImageReference

type ImageReference struct {
	BaseName       string
	Tag            string
	FullyQualified bool
}

ImageReference is a parsed image name.

func ParseReference

func ParseReference(image string) (*ImageReference, error)

ParseReference parses an image name to a reference.

type LocalDaemon

type LocalDaemon interface {
	Close() error
	ExtraEnv() []string
	ServerVersion(ctx context.Context) (types.Version, error)
	ConfigFile(ctx context.Context, image string) (*v1.ConfigFile, error)
	Build(ctx context.Context, out io.Writer, workspace string, a *latest.DockerArtifact, ref string) (string, error)
	Push(ctx context.Context, out io.Writer, ref string) (string, error)
	Pull(ctx context.Context, out io.Writer, ref string) error
	Load(ctx context.Context, out io.Writer, input io.Reader, ref string) (string, error)
	Tag(ctx context.Context, image, ref string) error
	ImageID(ctx context.Context, ref string) (string, error)
	ImageInspectWithRaw(ctx context.Context, image string) (types.ImageInspect, []byte, error)
	ImageRemove(ctx context.Context, image string, opts types.ImageRemoveOptions) ([]types.ImageDeleteResponseItem, error)
	RepoDigest(ctx context.Context, ref string) (string, error)
	ImageList(ctx context.Context, options types.ImageListOptions) ([]types.ImageSummary, error)
	ImageExists(ctx context.Context, ref string) bool
}

LocalDaemon talks to a local Docker API.

func NewAPIClient

func NewAPIClient(forceRemove bool, insecureRegistries map[string]bool) (LocalDaemon, error)

NewAPIClient guesses the docker client to use based on current kubernetes context.

func NewLocalDaemon

func NewLocalDaemon(apiClient client.CommonAPIClient, extraEnv []string, forceRemove bool, insecureRegistries map[string]bool) LocalDaemon

NewLocalDaemon creates a new LocalDaemon.

type PushResult

type PushResult struct {
	Digest string
}

PushResult gives the information on an image that has been pushed.

Jump to

Keyboard shortcuts

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