mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-04 12:41:34 +02:00
Add support for insecure docker registry (#131)
* Add support for insecure docker registry Using --insecure-skip-tls-verify Fixes #110 * Apply formatting
This commit is contained in:
@@ -32,13 +32,14 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
dockerfilePath string
|
||||
destination string
|
||||
srcContext string
|
||||
snapshotMode string
|
||||
bucket string
|
||||
logLevel string
|
||||
force bool
|
||||
dockerfilePath string
|
||||
destination string
|
||||
srcContext string
|
||||
snapshotMode string
|
||||
bucket string
|
||||
dockerInsecureSkipTLSVerify bool
|
||||
logLevel string
|
||||
force bool
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -47,6 +48,7 @@ func init() {
|
||||
RootCmd.PersistentFlags().StringVarP(&bucket, "bucket", "b", "", "Name of the GCS bucket from which to access build context as tarball.")
|
||||
RootCmd.PersistentFlags().StringVarP(&destination, "destination", "d", "", "Registry the final image should be pushed to (ex: gcr.io/test/example:latest)")
|
||||
RootCmd.PersistentFlags().StringVarP(&snapshotMode, "snapshotMode", "", "full", "Set this flag to change the file attributes inspected during snapshotting")
|
||||
RootCmd.PersistentFlags().BoolVarP(&dockerInsecureSkipTLSVerify, "insecure-skip-tls-verify", "", false, "Push to insecure registry ignoring TLS verify")
|
||||
RootCmd.PersistentFlags().StringVarP(&logLevel, "verbosity", "v", constants.DefaultLogLevel, "Log level (debug, info, warn, error, fatal, panic")
|
||||
RootCmd.PersistentFlags().BoolVarP(&force, "force", "", false, "Force building outside of a container")
|
||||
}
|
||||
@@ -70,7 +72,7 @@ var RootCmd = &cobra.Command{
|
||||
}
|
||||
logrus.Warn("kaniko is being run outside of a container. This can have dangerous effects on your system")
|
||||
}
|
||||
if err := executor.DoBuild(dockerfilePath, srcContext, destination, snapshotMode); err != nil {
|
||||
if err := executor.DoBuild(dockerfilePath, srcContext, destination, snapshotMode, dockerInsecureSkipTLSVerify); err != nil {
|
||||
logrus.Error(err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user