summaryrefslogtreecommitdiff
path: root/pkg/bindings/images
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-12-02 10:30:48 +0100
committerGitHub <noreply@github.com>2021-12-02 10:30:48 +0100
commiteeb71490e57047202410821fe98fa4332371cb03 (patch)
tree7bd849c5905868a2663025333ea5e76cc1abc549 /pkg/bindings/images
parentc70878603af299a9c8b3e69b2299e71e6f52cc5f (diff)
parent0ddb094480e0dea132f1f81008baabd408bf1bdd (diff)
downloadpodman-eeb71490e57047202410821fe98fa4332371cb03.tar.gz
podman-eeb71490e57047202410821fe98fa4332371cb03.tar.bz2
podman-eeb71490e57047202410821fe98fa4332371cb03.zip
Merge pull request #12425 from tnk4on/remote-build-eval-containerfile
Fixed the containerfile not found during remote build
Diffstat (limited to 'pkg/bindings/images')
-rw-r--r--pkg/bindings/images/build.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/bindings/images/build.go b/pkg/bindings/images/build.go
index 25770fdfc..be6e5ab55 100644
--- a/pkg/bindings/images/build.go
+++ b/pkg/bindings/images/build.go
@@ -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)