Skip to content

Commit

Permalink
Validate dockerfilepath in buildconfig
Browse files Browse the repository at this point in the history
This PR will resolve #594 by validating dockerfilepath based on whether
it is relative path or not.
  • Loading branch information
surajnarwade committed May 18, 2017
1 parent 1c64b01 commit d86feee
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/loader/compose/compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 absolute path, it must be a relative path.", serviceConfig.Dockerfile, name)
}

// load ports
ports, err := loadPorts(composeServiceConfig.Ports)
if err != nil {
Expand Down

0 comments on commit d86feee

Please sign in to comment.