Skip to content

Commit

Permalink
Merge pull request containers#12425 from tnk4on/remote-build-eval-con…
Browse files Browse the repository at this point in the history
…tainerfile

Fixed the containerfile not found during remote build
  • Loading branch information
openshift-merge-robot authored Dec 2, 2021
2 parents c708786 + 0ddb094 commit eeb7149
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/bindings/images/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,11 @@ func Build(ctx context.Context, containerFiles []string, options entities.BuildO
}
c = tmpFile.Name()
}
cfDir := filepath.Dir(c)
if absDir, err := filepath.EvalSymlinks(cfDir); err == nil {
name := filepath.ToSlash(strings.TrimPrefix(c, cfDir+string(filepath.Separator)))
c = filepath.Join(absDir, name)
}
containerfile, err := filepath.Abs(c)
if err != nil {
logrus.Errorf("Cannot find absolute path of %v: %v", c, err)
Expand Down

0 comments on commit eeb7149

Please sign in to comment.