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:
linuxshokunin
2019-01-03 10:42:15 -06:00
committed by dlorenc
parent e3bb8bc71a
commit c3afcc0c7d
2 changed files with 20 additions and 1 deletions
+4
View File
@@ -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 {