mirror of
https://github.com/containers/podman.git
synced 2025-06-20 00:51:16 +08:00
Merge pull request #12425 from tnk4on/remote-build-eval-containerfile
Fixed the containerfile not found during remote build
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user