helper

package
v1.1.1-0...-9418116 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultContextPath = "./"

DefaultContextPath is the default context path to use

View Source
const DefaultDockerfilePath = "./Dockerfile"

DefaultDockerfilePath is the default dockerfile path to use

Variables

This section is empty.

Functions

func CreateTempDockerfile

func CreateTempDockerfile(dockerfile string, entrypoint []string, cmd []string, target string) (string, error)

CreateTempDockerfile creates a new temporary dockerfile that appends a new entrypoint and cmd

func GetDockerfileAndContext

func GetDockerfileAndContext(config *latest.Config, imageConfigName string, imageConf *latest.ImageConfig, isDev bool) (string, string)

GetDockerfileAndContext retrieves the dockerfile and context

func OverwriteDockerfileInBuildContext

func OverwriteDockerfileInBuildContext(dockerfileCtx io.ReadCloser, buildCtx io.ReadCloser, relDockerfile string) (io.ReadCloser, error)

OverwriteDockerfileInBuildContext will overwrite the dockerfile with the dockerfileCtx

Types

type BuildHelper

type BuildHelper struct {
	ImageConfigName string
	ImageConf       *latest.ImageConfig
	Config          *latest.Config

	DockerfilePath string
	ContextPath    string

	EngineName string
	ImageName  string
	ImageTag   string
	Entrypoint []string
	Cmd        []string

	IsDev      bool
	KubeClient kubectl.Client
}

BuildHelper is the helper class to store common functionality used by both the docker and kaniko builder

func NewBuildHelper

func NewBuildHelper(config *latest.Config, kubeClient kubectl.Client, engineName string, imageConfigName string, imageConf *latest.ImageConfig, imageTag string, isDev bool) *BuildHelper

NewBuildHelper creates a new build helper for a certain engine

func (*BuildHelper) Build

func (b *BuildHelper) Build(imageBuilder BuildHelperInterface, log log.Logger) error

Build builds a new image

func (*BuildHelper) ShouldRebuild

func (b *BuildHelper) ShouldRebuild(cache *generated.CacheConfig, forceRebuild, ignoreContextPathChanges bool) (bool, error)

ShouldRebuild determines if the image should be rebuilt

type BuildHelperInterface

type BuildHelperInterface interface {
	BuildImage(absoluteContextPath string, absoluteDockerfilePath string, entrypoint []string, cmd []string, log log.Logger) error
}

BuildHelperInterface is the interface the build helper uses to build an image

Jump to

Keyboard shortcuts

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