mirror of
https://github.com/containers/podman.git
synced 2026-08-07 04:43:04 -04:00
Support podman --remote when Containerfile is not in context directory
Fixes: https://github.com/containers/podman/issues/18239 [NO NEW TESTS NEEDED] @test "podman build -f test" in test/system/070-build.bats Will test this. This was passing when run on a local system since the remote end was using the clients path to read the Containerfile The issue is it would not work in a podman machine since the Containerfile would/should be a different path. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
4 files changed
+29
-25
No files matched your search
@@ -221,9 +221,11 @@ func BuildImage(w http.ResponseWriter, r *http.Request) {
|
||||
var m = []string{}
|
||||
if err := json.Unmarshal([]byte(query.Dockerfile), &m); err != nil {
|
||||
// it's not json, assume just a string
|
||||
m = []string{filepath.Join(contextDirectory, query.Dockerfile)}
|
||||
m = []string{query.Dockerfile}
|
||||
}
|
||||
for _, containerfile := range m {
|
||||
containerFiles = append(containerFiles, filepath.Join(contextDirectory, filepath.Clean(filepath.FromSlash(containerfile))))
|
||||
}
|
||||
containerFiles = m
|
||||
dockerFileSet = true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user