Documentation ¶
Index ¶
- Variables
- func CreateDockerTarContext(ctx context.Context, w io.Writer, workspace string, a *latest.DockerArtifact, ...) error
- func GetBuildArgs(a *latest.DockerArtifact) ([]string, error)
- func GetDependencies(ctx context.Context, workspace string, dockerfilePath string, ...) ([]string, error)
- func NormalizeDockerfilePath(context, dockerfile string) (string, error)
- func Prune(ctx context.Context, out io.Writer, images []string, client LocalDaemon) error
- func RemoteDigest(identifier string, insecureRegistries map[string]bool) (string, error)
- func RetrieveRemoteConfig(identifier string, insecureRegistries map[string]bool) (*v1.ConfigFile, error)
- func ValidateDockerfile(path string) bool
- func WalkWorkspace(workspace string, excludes, deps []string) (map[string]bool, error)
- type AuthConfigHelper
- type BuildResult
- type ImageReference
- type LocalDaemon
- type PushResult
Constants ¶
This section is empty.
Variables ¶
var RetrieveImage = retrieveImage
RetrieveImage is overridden for unit testing
Functions ¶
func CreateDockerTarContext ¶
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 ¶
NormalizeDockerfilePath returns the absolute path to the dockerfile.
func RemoteDigest ¶
func RetrieveRemoteConfig ¶
func RetrieveRemoteConfig(identifier string, insecureRegistries map[string]bool) (*v1.ConfigFile, error)
RetrieveRemoteConfig retrieves the remote config file for an image
func ValidateDockerfile ¶
ValidateDockerfile makes sure the given Dockerfile is existing and valid.
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 ¶
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.