mirror of
https://github.com/containers/podman.git
synced 2026-11-08 09:02:51 -05:00
When localapi finds the build context on a running machine's mount it translated options.ContextDirectory into the machine path. pkg/bindings runs on the client, and build() still creates files under the context directory there: the temporary files for --secret, and a Containerfile read from stdin. On Windows that meant creating "/mnt/c/.../podman-build-secret-*" on the host, which fails. Keep options.ContextDirectory as the client path and record the machine path in a new RemoteContextDirectory field, used only when the local build request is prepared (the localcontextdir parameter). The Containerfile, additional build context and ignore file paths are still translated as before; the server accepts them as absolute machine paths. A caller of BuildFromServerContext that already passes a machine path leaves the new field empty and is sent as is. Add a unit test for the request parameter in both cases. Fixes: #29223 Translated with an LLM from Chinese. Signed-off-by: Jingze Liu <110184138+Theodore-Liu@users.noreply.github.com>