diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-12-02 10:30:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-02 10:30:48 +0100 |
commit | eeb71490e57047202410821fe98fa4332371cb03 (patch) | |
tree | 7bd849c5905868a2663025333ea5e76cc1abc549 /pkg | |
parent | c70878603af299a9c8b3e69b2299e71e6f52cc5f (diff) | |
parent | 0ddb094480e0dea132f1f81008baabd408bf1bdd (diff) | |
download | podman-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')
-rw-r--r-- | pkg/bindings/images/build.go | 5 |
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) |