add skip-tls-verify flag for insecure private registries (#11)

Co-authored-by: beniamin.calota <beniamin.calota@emag.ro>
This commit is contained in:
Beniamin
2021-02-18 10:19:21 +02:00
committed by GitHub
parent 3e4dad8cae
commit 9cca954ec6
2 changed files with 18 additions and 7 deletions
+12 -7
View File
@@ -10,13 +10,14 @@ import (
type (
// Build defines Docker build parameters.
Build struct {
Dockerfile string // Docker build Dockerfile
Context string // Docker build context
Tags []string // Docker build tags
Args []string // Docker build args
Target string // Docker build target
Repo string // Docker build repository
Labels []string // Label map
Dockerfile string // Docker build Dockerfile
Context string // Docker build context
Tags []string // Docker build tags
Args []string // Docker build args
Target string // Docker build target
Repo string // Docker build repository
Labels []string // Label map
SkipTlsVerify bool // Docker skip tls certificate verify for registry
}
// Plugin defines the Docker plugin parameters.
@@ -57,6 +58,10 @@ func (p Plugin) Exec() error {
cmdArgs = append(cmdArgs, fmt.Sprintf("--target=%s", p.Build.Target))
}
if p.Build.SkipTlsVerify {
cmdArgs = append(cmdArgs, fmt.Sprintf("--skip-tls-verify=true"))
}
cmd := exec.Command("/kaniko/executor", cmdArgs...)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr