Skip to content

Additional build contexts should be sent as additional tar files #23433

@l0rd

Description

@l0rd

Feature request description

Option --build-context <label>=<context-path> of the podman build command allows to specify additional build contexts. The podman client doesn't send these additional build contexts as tar files in the current implementation. Only the main build context is sent.

Since podman doesn't send the build contexts to the remote machine, and only passes its local path as an API parameter, the build usually fails because the context path doesn't exist in the remote machine. It only works in the cases where the build context path is mounted, on the same path, in the remote machine. But in the general case, it doesn't.

Suggest potential solution

A reasonable way to resolve the problem is to transfer every additional build context as a tar file. And change the build HTTP request content to be multi-part. However, we should investigate how Docker handles that, as it's not part of the core engine API (additional build contexts are a buildx feature). So, we should look at how a Docker client handles it and work on a compatible solution.

Have you considered any alternatives?

On Windows and macOS the problem is mitigated by mounting, in the remote machine, $HOME and other system folders. But if the user overrides the default machine mounts, the machine is in a remote machine etc...the podman build command will still fail.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    jirakind/featureCategorizes issue or PR as related to a new feature.locked - please file new issue/PRAssist humans wanting to comment on an old issue or PR with locked comments.remoteProblem is in podman-remote

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions