Documentation
¶
Index ¶
- Variables
- func Cleanup() error
- func EnvBool(key string) bool
- func EnvBoolDefault(key string, def bool) bool
- func InitFeatureFlags()
- func LogFeatureFlags()
- type CacheOptions
- type Compression
- type FeatureFlags
- type ImageFormat
- type KanikoGitOptions
- type KanikoOptions
- type KanikoStage
- type RegistryOptions
- type SecretOption
- type SecretOptions
- type WarmerOptions
Constants ¶
This section is empty.
Variables ¶
var BuildContextDir = KanikoDir + "/buildcontext/"
BuildContextDir is the directory a build context will be unpacked into, for example, a tarball from a GCS bucket will be unpacked here
var DockerConfigDir = KanikoDir + "/.docker/"
DockerConfigDir is a where registry credentials are stored
var DockerfilePath = KanikoDir + "/Dockerfile"
DockerfilePath is the path the Dockerfile is copied to
var ErrInvalidGitFlag = errors.New("invalid git flag, must be in the key=value format")
var KanikoCacheDir = KanikoDir + "/caches/"
KanikoCacheDir is where we will store cache mount directories, ie. RUN --mount=type=cache,target=/var/lib/apt/lists/ Contents are stored as-is.
var KanikoDir = func() string { if kd, ok := os.LookupEnv("KANIKO_DIR"); ok { return kd } return KanikoExeDir }()
var KanikoExeDir = func() string { exePath, err := os.Executable() if err != nil { logrus.Fatalf("couldn't determine location of kaniko exe") } return filepath.Dir(exePath) }()
KanikoDir is the path to the Kaniko directory
var KanikoInterStageDepsDir = func() string { return KanikoDir + "/deps/" }()
KanikoInsterStageDir is where we will store inter-stage dependencies Contents are stored as-is.
var KanikoIntermediateStagesDir = KanikoDir + "/stages/"
KanikoIntermediateStagesDir is where we will store intermediate stages as tarballs in case they are needed later on
var KanikoLayersDir = func() string { return KanikoDir + "/layers/" }()
KanikoLayersDir is where we will store layers as tarballs
var KanikoSecretsBeforeDir = KanikoExeDir + "/secrets/"
KanikoSecretsDir is a where user defined secrets are stored KanikoSecretsBeforeDir is where secrets are staged before moveKanikoDir runs
var KanikoSecretsDir = KanikoDir + "/secrets/"
var KanikoSwapDir = KanikoDir + "/swap/"
KanikoSwapDir is a temporary directory used to swap out cache and target directories
var MountInfoPath string
var RootDir string
var TiniExec = KanikoDir + "/tini"
Functions ¶
func EnvBoolDefault ¶ added in v1.26.0
func InitFeatureFlags ¶ added in v1.28.1
func InitFeatureFlags()
func LogFeatureFlags ¶ added in v1.28.1
func LogFeatureFlags()
Types ¶
type CacheOptions ¶
CacheOptions are base image cache options that are set by command line arguments
type Compression ¶
type Compression string
Compression is an enumeration of the supported compression algorithms
const ( GZip Compression = "gzip" ZStd Compression = "zstd" )
The collection of known MediaType values.
func (*Compression) Set ¶
func (c *Compression) Set(v string) error
func (*Compression) String ¶
func (c *Compression) String() string
func (*Compression) Type ¶
func (c *Compression) Type() string
type FeatureFlags ¶ added in v1.28.1
type FeatureFlags struct {
BuildkitArgEnvPrecedence bool
CacheLookahead bool
CacheProbeAfterMiss bool
CleanKanikoDir bool
CopyAsRoot bool
CopyChmodOnImplicitDirs bool
DeprecateInterStageRestore bool
DisableHTTP2 bool
ExpandHeredoc bool
HashDirFraming bool
IgnoreCachedManifest bool
InferCrossStageCacheKey bool
NoPropagateAnnotations bool
OCIScratchBase bool
OCIWarmer bool
PrecompileDockerignore bool
PreserveHardlinks bool
PreserveMountedPaths bool
ReproduciblePreserveBaseLayers bool
ResolveCacheKey bool
RollingCacheKey bool
RunHonorGroup bool
RunMountBind bool
RunViaTini bool
ScopedDockerignore bool
SecurejoinExtraction bool
SkipRelabelRecompress bool
SkipWriteWhiteouts bool
UntarSkipRoot bool
VolumeSkipMkdir bool
WarmerCacheLock bool
}
var FF FeatureFlags
type ImageFormat ¶ added in v1.28.1
type ImageFormat string
ImageFormat is the output image media type unset means inherit from the base image (legacy behaviour)
const ( ImageFormatInherit ImageFormat = "" ImageFormatDocker ImageFormat = "docker" ImageFormatOCI ImageFormat = "oci" )
func (*ImageFormat) Set ¶ added in v1.28.1
func (f *ImageFormat) Set(v string) error
func (*ImageFormat) String ¶ added in v1.28.1
func (f *ImageFormat) String() string
func (*ImageFormat) Type ¶ added in v1.28.1
func (f *ImageFormat) Type() string
type KanikoGitOptions ¶
type KanikoGitOptions struct {
Branch string
SingleBranch bool
Depth int
RecurseSubmodules bool
InsecureSkipTLS bool
}
func (*KanikoGitOptions) Set ¶
func (k *KanikoGitOptions) Set(s string) error
func (*KanikoGitOptions) String ¶
func (k *KanikoGitOptions) String() string
func (*KanikoGitOptions) Type ¶
func (k *KanikoGitOptions) Type() string
type KanikoOptions ¶
type KanikoOptions struct {
RegistryOptions
CacheOptions
Destinations multiArg
BuildArgs multiArg
Labels multiArg
Annotations keyValueArg
Git KanikoGitOptions
IgnorePaths multiArg
DockerfilePath string
SrcContext string
SnapshotMode string
SnapshotModeDeprecated string
CustomPlatform string
CustomPlatformDeprecated string
Bucket string
TarPath string
TarPathDeprecated string
KanikoDir string
Target []string
CacheRepo string
DigestFile string
ImageNameDigestFile string
ImageNameTagDigestFile string
OCILayoutPath string
Compression Compression
ImageFormat ImageFormat
CompressionLevel int
ImageFSExtractRetry int
SingleSnapshot bool
Reproducible bool
NoPush bool
NoPushCache bool
Cache bool
PreCleanup bool
Cleanup bool
CompressedCaching bool
IgnoreVarRun bool
SkipUnusedStagesDeprecated bool
RunV2 bool
CacheCopyLayers bool
CacheRunLayers bool
ForceBuildMetadataDeprecated bool
InitialFSUnpacked bool
SkipPushPermissionCheck bool
PreserveContext bool
Materialize bool
Secrets SecretOptions
Dryrun bool
}
KanikoOptions are options that are set by command line arguments
type KanikoStage ¶
type KanikoStage struct {
Name string
BaseName string
Commands []instructions.Command
BaseImageIndex int
Push bool
Final bool
BaseImageStoredLocally bool
SaveStage bool
MetaArgs []instructions.ArgCommand
Index int
}
KanikoStage wraps a stage of the Dockerfile and provides extra information
type RegistryOptions ¶
type RegistryOptions struct {
RegistryMaps multiKeyMultiValueArg
RegistryMirrors multiArg
InsecureRegistries multiArg
SkipTLSVerifyRegistries multiArg
RegistriesCertificates keyValueArg
RegistriesClientCertificates keyValueArg
SkipDefaultRegistryFallback bool
Insecure bool
SkipTLSVerify bool
InsecurePull bool
SkipTLSVerifyPull bool
PushIgnoreImmutableTagErrors bool
PushRetry int
ImageDownloadRetry int
CredentialHelpers multiArg
}
RegistryOptions are all the options related to the registries, set by command line arguments.
type SecretOption ¶ added in v1.26.3
type SecretOptions ¶ added in v1.26.3
type SecretOptions map[string]SecretOption
func (*SecretOptions) Set ¶ added in v1.26.3
func (s *SecretOptions) Set(val string) error
parsing --secret analogous to buildx reference https://docs.docker.com/reference/cli/docker/buildx/build/#secret
func (*SecretOptions) String ¶ added in v1.26.3
func (s *SecretOptions) String() string
func (*SecretOptions) Type ¶ added in v1.26.3
func (k *SecretOptions) Type() string
type WarmerOptions ¶
type WarmerOptions struct {
CacheOptions
RegistryOptions
CustomPlatform string
Images multiArg
Force bool
DockerfilePath string
BuildArgs multiArg
}
WarmerOptions are options that are set by command line arguments to the cache warmer.