Documentation
¶
Index ¶
- Constants
- func CreateTempDockerfile(dockerfile string, entrypoint []string, cmd []string, target string) (string, error)
- func GetDockerfileAndContext(config *latest.Config, imageConfigName string, imageConf *latest.ImageConfig, ...) (string, string)
- func OverwriteDockerfileInBuildContext(dockerfileCtx io.ReadCloser, buildCtx io.ReadCloser, relDockerfile string) (io.ReadCloser, error)
- type BuildHelper
- type BuildHelperInterface
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
Click to show internal directories.
Click to hide internal directories.