summaryrefslogtreecommitdiff
path: root/cmd/podman/build.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2019-11-04 10:08:17 -0500
committerGitHub <noreply@github.com>2019-11-04 10:08:17 -0500
commit8e5aad97dda150f8e871c1b394824496f4b849ea (patch)
tree398ca3e287a1b7f0670afa3d280b724bc7c2f96a /cmd/podman/build.go
parentefc7f1557b4af90263f4f07e5e576b02e839fad1 (diff)
parent677a0e5d60c45711cba56032c23783c1d010a49e (diff)
downloadpodman-8e5aad97dda150f8e871c1b394824496f4b849ea.tar.gz
podman-8e5aad97dda150f8e871c1b394824496f4b849ea.tar.bz2
podman-8e5aad97dda150f8e871c1b394824496f4b849ea.zip
Merge pull request #4389 from TomSweeneyRedHat/dev/tsweeney/contextdir
Validate contextdir on build
Diffstat (limited to 'cmd/podman/build.go')
-rw-r--r--cmd/podman/build.go3
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"))