mirror of
https://github.com/drone/drone-kaniko.git
synced 2026-06-14 05:12:27 +08:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3408e961b0 | |||
| bae2414e0a |
@@ -451,6 +451,7 @@ func run(c *cli.Context) error {
|
|||||||
SkipTLSVerifyRegistry: c.Bool("skip-tls-verify-registry"),
|
SkipTLSVerifyRegistry: c.Bool("skip-tls-verify-registry"),
|
||||||
UseNewRun: c.Bool("use-new-run"),
|
UseNewRun: c.Bool("use-new-run"),
|
||||||
IgnorePath: c.String("ignore-path"),
|
IgnorePath: c.String("ignore-path"),
|
||||||
|
IgnorePaths: c.StringSlice("ignore-paths"),
|
||||||
ImageFSExtractRetry: c.Int("image-fs-extract-retry"),
|
ImageFSExtractRetry: c.Int("image-fs-extract-retry"),
|
||||||
ImageDownloadRetry: c.Int("image-download-retry"),
|
ImageDownloadRetry: c.Int("image-download-retry"),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -353,6 +353,11 @@ func main() {
|
|||||||
Usage: "Path to ignore during the build.",
|
Usage: "Path to ignore during the build.",
|
||||||
EnvVar: "PLUGIN_IGNORE_PATH",
|
EnvVar: "PLUGIN_IGNORE_PATH",
|
||||||
},
|
},
|
||||||
|
cli.StringFlag{
|
||||||
|
Name: "ignore-paths",
|
||||||
|
Usage: "Path to ignore during the build.",
|
||||||
|
EnvVar: "PLUGIN_IGNORE_PATHS",
|
||||||
|
},
|
||||||
cli.IntFlag{
|
cli.IntFlag{
|
||||||
Name: "image-fs-extract-retry",
|
Name: "image-fs-extract-retry",
|
||||||
Usage: "Number of retries for extracting filesystem layers.",
|
Usage: "Number of retries for extracting filesystem layers.",
|
||||||
@@ -460,6 +465,7 @@ func run(c *cli.Context) error {
|
|||||||
SourceTarPath: c.String("source-tar-path"),
|
SourceTarPath: c.String("source-tar-path"),
|
||||||
UseNewRun: c.Bool("use-new-run"),
|
UseNewRun: c.Bool("use-new-run"),
|
||||||
IgnorePath: c.String("ignore-path"),
|
IgnorePath: c.String("ignore-path"),
|
||||||
|
IgnorePaths: c.StringSlice("ignore-paths"),
|
||||||
|
|
||||||
ImageFSExtractRetry: c.Int("image-fs-extract-retry"),
|
ImageFSExtractRetry: c.Int("image-fs-extract-retry"),
|
||||||
ImageDownloadRetry: c.Int("image-download-retry"),
|
ImageDownloadRetry: c.Int("image-download-retry"),
|
||||||
|
|||||||
@@ -518,6 +518,7 @@ func run(c *cli.Context) error {
|
|||||||
SkipTLSVerifyRegistry: c.Bool("skip-tls-verify-registry"),
|
SkipTLSVerifyRegistry: c.Bool("skip-tls-verify-registry"),
|
||||||
UseNewRun: c.Bool("use-new-run"),
|
UseNewRun: c.Bool("use-new-run"),
|
||||||
IgnorePath: c.String("ignore-path"),
|
IgnorePath: c.String("ignore-path"),
|
||||||
|
IgnorePaths: c.StringSlice("ignore-paths"),
|
||||||
ImageFSExtractRetry: c.Int("image-fs-extract-retry"),
|
ImageFSExtractRetry: c.Int("image-fs-extract-retry"),
|
||||||
ImageDownloadRetry: c.Int("image-download-retry"),
|
ImageDownloadRetry: c.Int("image-download-retry"),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -414,6 +414,7 @@ func run(c *cli.Context) error {
|
|||||||
SkipTLSVerifyRegistry: c.Bool("skip-tls-verify-registry"),
|
SkipTLSVerifyRegistry: c.Bool("skip-tls-verify-registry"),
|
||||||
UseNewRun: c.Bool("use-new-run"),
|
UseNewRun: c.Bool("use-new-run"),
|
||||||
IgnorePath: c.String("ignore-path"),
|
IgnorePath: c.String("ignore-path"),
|
||||||
|
IgnorePaths: c.StringSlice("ignore-paths"),
|
||||||
ImageFSExtractRetry: c.Int("image-fs-extract-retry"),
|
ImageFSExtractRetry: c.Int("image-fs-extract-retry"),
|
||||||
ImageDownloadRetry: c.Int("image-download-retry"),
|
ImageDownloadRetry: c.Int("image-download-retry"),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -416,6 +416,7 @@ func run(c *cli.Context) error {
|
|||||||
SkipTLSVerifyRegistry: c.Bool("skip-tls-verify-registry"),
|
SkipTLSVerifyRegistry: c.Bool("skip-tls-verify-registry"),
|
||||||
UseNewRun: c.Bool("use-new-run"),
|
UseNewRun: c.Bool("use-new-run"),
|
||||||
IgnorePath: c.String("ignore-path"),
|
IgnorePath: c.String("ignore-path"),
|
||||||
|
IgnorePaths: c.StringSlice("ignore-paths"),
|
||||||
ImageFSExtractRetry: c.Int("image-fs-extract-retry"),
|
ImageFSExtractRetry: c.Int("image-fs-extract-retry"),
|
||||||
ImageDownloadRetry: c.Int("image-download-retry"),
|
ImageDownloadRetry: c.Int("image-download-retry"),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -49,41 +49,42 @@ type (
|
|||||||
Target string // Docker build target
|
Target string // Docker build target
|
||||||
Verbosity string // Log level
|
Verbosity string // Log level
|
||||||
|
|
||||||
Cache bool // Enable or disable caching during the build process.
|
Cache bool // Enable or disable caching during the build process.
|
||||||
CacheDir string // Directory to store cached layers.
|
CacheDir string // Directory to store cached layers.
|
||||||
CacheCopyLayers bool // Enable or disable copying layers from the cache.
|
CacheCopyLayers bool // Enable or disable copying layers from the cache.
|
||||||
CacheRunLayers bool // Enable or disable running layers from the cache.
|
CacheRunLayers bool // Enable or disable running layers from the cache.
|
||||||
Cleanup bool // Enable or disable cleanup of temporary files.
|
Cleanup bool // Enable or disable cleanup of temporary files.
|
||||||
CompressedCaching *bool // Enable or disable compressed caching.
|
CompressedCaching *bool // Enable or disable compressed caching.
|
||||||
ContextSubPath string // Sub-path within the context to build.
|
ContextSubPath string // Sub-path within the context to build.
|
||||||
CustomPlatform string // Platform to use for building.
|
CustomPlatform string // Platform to use for building.
|
||||||
Force bool // Force building the image even if it already exists.
|
Force bool // Force building the image even if it already exists.
|
||||||
Git bool // Branch to clone if build context is a git repository .
|
Git bool // Branch to clone if build context is a git repository .
|
||||||
ImageNameWithDigestFile string // Write image name with digest to a file.
|
ImageNameWithDigestFile string // Write image name with digest to a file.
|
||||||
ImageNameTagWithDigestFile string // Write image name with tag and digest to a file.
|
ImageNameTagWithDigestFile string // Write image name with tag and digest to a file.
|
||||||
Insecure bool // Allow connecting to registries without TLS.
|
Insecure bool // Allow connecting to registries without TLS.
|
||||||
InsecurePull bool // Allow insecure pulls from the registry.
|
InsecurePull bool // Allow insecure pulls from the registry.
|
||||||
InsecureRegistry string // Use plain HTTP for registry communication.
|
InsecureRegistry string // Use plain HTTP for registry communication.
|
||||||
Label string // Add metadata to an image.
|
Label string // Add metadata to an image.
|
||||||
LogFormat string // Set the log format for build output.
|
LogFormat string // Set the log format for build output.
|
||||||
LogTimestamp bool // Show timestamps in build output.
|
LogTimestamp bool // Show timestamps in build output.
|
||||||
OCILayoutPath string // Directory to store OCI layout.
|
OCILayoutPath string // Directory to store OCI layout.
|
||||||
PushRetry int // Number of times to retry pushing an image.
|
PushRetry int // Number of times to retry pushing an image.
|
||||||
RegistryCertificate string // Path to a file containing a registry certificate.
|
RegistryCertificate string // Path to a file containing a registry certificate.
|
||||||
RegistryClientCert string // Path to a file containing a registry client certificate.
|
RegistryClientCert string // Path to a file containing a registry client certificate.
|
||||||
RegistryMirror string // Mirror for registry pulls.
|
RegistryMirror string // Mirror for registry pulls.
|
||||||
SkipDefaultRegistryFallback bool // Skip Docker Hub and default registry fallback.
|
SkipDefaultRegistryFallback bool // Skip Docker Hub and default registry fallback.
|
||||||
Reproducible bool // Create a reproducible image.
|
Reproducible bool // Create a reproducible image.
|
||||||
SingleSnapshot bool // Only create a single snapshot of the image.
|
SingleSnapshot bool // Only create a single snapshot of the image.
|
||||||
SkipTLSVerify bool // Skip TLS verification when connecting to the registry.
|
SkipTLSVerify bool // Skip TLS verification when connecting to the registry.
|
||||||
SkipPushPermissionCheck bool // Skip permission check when pushing.
|
SkipPushPermissionCheck bool // Skip permission check when pushing.
|
||||||
SkipTLSVerifyPull bool // Skip TLS verification when pulling.
|
SkipTLSVerifyPull bool // Skip TLS verification when pulling.
|
||||||
SkipTLSVerifyRegistry bool // Skip TLS verification when connecting to a registry.
|
SkipTLSVerifyRegistry bool // Skip TLS verification when connecting to a registry.
|
||||||
UseNewRun bool // Use the new container runtime (`runc`) for builds.
|
UseNewRun bool // Use the new container runtime (`runc`) for builds.
|
||||||
IgnoreVarRun *bool // Ignore `/var/run` when copying from the context.
|
IgnoreVarRun *bool // Ignore `/var/run` when copying from the context.
|
||||||
IgnorePath string // Ignore files matching the specified path pattern.
|
IgnorePath string // Ignore files matching the specified path pattern.
|
||||||
ImageFSExtractRetry int // Number of times to retry extracting the image filesystem.
|
IgnorePaths []string // Ignore files matching the specified path pattern.
|
||||||
ImageDownloadRetry int // Number of times to retry downloading layers.
|
ImageFSExtractRetry int // Number of times to retry extracting the image filesystem.
|
||||||
|
ImageDownloadRetry int // Number of times to retry downloading layers.
|
||||||
}
|
}
|
||||||
|
|
||||||
// Artifact defines content of artifact file
|
// Artifact defines content of artifact file
|
||||||
@@ -448,6 +449,15 @@ func (p Plugin) Exec() error {
|
|||||||
cmdArgs = append(cmdArgs, fmt.Sprintf("--ignore-path=%s", p.Build.IgnorePath))
|
cmdArgs = append(cmdArgs, fmt.Sprintf("--ignore-path=%s", p.Build.IgnorePath))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if p.Build.IgnorePaths != nil {
|
||||||
|
for _, path := range p.Build.IgnorePaths {
|
||||||
|
trimmed := strings.TrimSpace(path)
|
||||||
|
if trimmed != "" {
|
||||||
|
cmdArgs = append(cmdArgs, fmt.Sprintf("--ignore-path=%s", trimmed))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if p.Build.ImageFSExtractRetry != 0 {
|
if p.Build.ImageFSExtractRetry != 0 {
|
||||||
cmdArgs = append(cmdArgs, fmt.Sprintf("--image-fs-extract-retry=%d", p.Build.ImageFSExtractRetry))
|
cmdArgs = append(cmdArgs, fmt.Sprintf("--image-fs-extract-retry=%d", p.Build.ImageFSExtractRetry))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user