mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-21 08:17:12 +02:00
Adding capability to get Dockerfile from URL. (#500)
* Changed to set http or https in Dockerfile path. * Fixed return value when error. * Fixed ineffectual error
This commit is contained in:
@@ -20,6 +20,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -141,6 +142,9 @@ func cacheFlagsValid() error {
|
||||
|
||||
// resolveDockerfilePath resolves the Dockerfile path to an absolute path
|
||||
func resolveDockerfilePath() error {
|
||||
if match, _ := regexp.MatchString("^https?://", opts.DockerfilePath); match {
|
||||
return nil
|
||||
}
|
||||
if util.FilepathExists(opts.DockerfilePath) {
|
||||
abs, err := filepath.Abs(opts.DockerfilePath)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user