From cdd15102104fc7e7066535154d19754c35ea5c8a Mon Sep 17 00:00:00 2001 From: Shubham Agrawal Date: Fri, 29 Jan 2021 14:39:06 +0530 Subject: [PATCH] Log error if dockerfile does not exist at provided path --- kaniko.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kaniko.go b/kaniko.go index 8381d0f..0149642 100644 --- a/kaniko.go +++ b/kaniko.go @@ -31,6 +31,10 @@ func (p Plugin) Exec() error { return fmt.Errorf("repository name to publish image must be specified") } + if _, err := os.Stat(p.Build.Dockerfile); os.IsNotExist(err) { + return fmt.Errorf("dockerfile does not exist at path: %s", p.Build.Dockerfile) + } + cmdArgs := []string{ fmt.Sprintf("--dockerfile=%s", p.Build.Dockerfile), fmt.Sprintf("--context=dir://%s", p.Build.Context),