diff options
Diffstat (limited to 'cmd/podman/build.go')
-rw-r--r-- | cmd/podman/build.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/cmd/podman/build.go b/cmd/podman/build.go index 896d5661a..bbc1d5b5f 100644 --- a/cmd/podman/build.go +++ b/cmd/podman/build.go @@ -238,6 +238,9 @@ func buildCmd(c *cliconfig.BuildValues) error { if contextDir == "" { return errors.Errorf("no context directory specified, and no containerfile specified") } + if !fileIsDir(contextDir) { + return errors.Errorf("context must be a directory: %v", contextDir) + } if len(containerfiles) == 0 { if checkIfFileExists(filepath.Join(contextDir, "Containerfile")) { containerfiles = append(containerfiles, filepath.Join(contextDir, "Containerfile")) |