Validate dockerfilepath in buildconfig

This PR will resolve #594 by validating dockerfilepath based on whether
it is relative path or not.
This commit is contained in:
Suraj Narwade
2017-05-30 16:31:20 +05:30
parent 2a708bcdcf
commit 581e181967
3 changed files with 15 additions and 0 deletions
+5
View File
@@ -330,6 +330,11 @@ func (c *Compose) LoadFile(files []string) (kobject.KomposeObject, error) {
envs := loadEnvVars(composeServiceConfig.Environment)
serviceConfig.Environment = envs
//Validate dockerfile path
if filepath.IsAbs(serviceConfig.Dockerfile) {
log.Fatalf("%q defined in service %q is an absolute path, it must be a relative path.", serviceConfig.Dockerfile, name)
}
// load ports
ports, err := loadPorts(composeServiceConfig.Ports)
if err != nil {